[ create a new paste ] login | about

Link: http://codepad.org/2IKYL5rM    [ raw code | output | fork ]

C, pasted on Nov 22:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
#include <stdlib.h>

struct Node{
	int arr[5];
};

int main(void) {
	Node* nodeArr = (Node*)malloc(sizeof(struct Node));
	nodeArr->arr = (int *)malloc(sizeof(int)*5);
	for(i=0;i<3;i++){
		nodeArr->arr[i] = i+1;
	}
	printf("%d",nodeArr->arr[0]);
}


Output:
1
2
3
4
5
6
7
In function 'main':
Line 9: error: 'Node' undeclared (first use in this function)
Line 9: error: (Each undeclared identifier is reported only once
Line 9: error: for each function it appears in.)
Line 9: error: 'nodeArr' undeclared (first use in this function)
Line 9: error: expected expression before ')' token
Line 11: error: 'i' undeclared (first use in this function)


Create a new paste based on this one


Comments: