Created
September 6, 2010 14:40
-
-
Save draftcode/567108 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
struct list { | |
int val; | |
struct list *next; | |
}; | |
struct list *newlist() | |
{ | |
struct list l; | |
l.val = 0; | |
l.next = NULL; | |
return &l; | |
} | |
int main(void) | |
{ | |
struct list *p = newlist(); | |
p->val = 10; | |
p->next = newlist(); | |
p->next->val = 20; | |
printf("%d %d¥n", p->val, p->next->val); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good \o