Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct List {
- int val;
- struct List* next;
- };
- typedef struct List List;
- void function2(List* arg) {
- arg->val = 5;
- printf("%d\n", arg->val);
- arg = arg->next;
- }
- void function1(List** arg) {
- (*arg)->val = 5;
- printf("%d\n", (*arg)->val);
- *arg = (*arg)->next;
- }
- int main() {
- List* lista = (List*) malloc(sizeof(struct List));
- lista->next = NULL;
- function1(&lista);
- if (lista == NULL) {
- printf("JEST\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement