Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdilib.h>
- #include<stdio.h>
- #include<stdint.h>
- struct s_nodo{
- uint8_t ID;
- struct s_nodo* v;
- };
- typedef struct s_nodo s_n;
- typedef struct s_nodo* p_n; //Paso A y Paso B
- p_n crea_nodo(uint8_t ID){
- p_n p;
- p=malloc(sizeof(s_n));
- if(p==NULL){
- perror("Error en crea_nodo()\n");
- exit(EXIT_FAILURE);
- }
- p->ID=ID;
- p->v=NULL;
- return (p);
- }
- int main(){
- p_n inicio;
- inicio=crea_nodo('A');
- inicio->v=crea_nodo('B');
- }
Advertisement
Add Comment
Please, Sign In to add comment