[ create a new paste ] login | about

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

C, pasted on Jul 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include<stdio.h>
	struct stud
	{
		char name[20]="xyz";
		int rollNo=20;
		int age=18;
	}student;

	int main()
	{
		printf("Name: %s \n", student.name);
		return 0;
	}


Output:
1
2
3
Line 4: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
In function 'main':
Line 11: error: 'struct stud' has no member named 'name'


Create a new paste based on this one


Comments: