Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct lista
- {
- int a_value;
- int *next_element;
- };
- typedef struct lista Item;
- Item *asd1;
- int *curr = NULL;
- int *createnewitem(int val, int *ptr)
- {
- Item *ritem;
- ritem = (Item *) malloc(sizeof(val));
- ritem->a_value = val;
- ritem->next_element = NULL;
- *ptr = &ritem;
- return curr;
- }
- int main(int argc, char **argv)
- {
- asd1 = createnewitem(123,curr);
- createnewitem(456,curr);
- createnewitem(789,curr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement