[ create a new paste ] login | about

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

C, pasted on May 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include<stdio.h>
struct student
{
   char no[10];
};

int main()
{
   struct student stu={ "2018"};
   struct student* p=NULL;

   p=&stu;
   printf("%s, %s", (*p).no, p.no);
}


Output:
1
2
In function 'main':
Line 13: error: request for member 'no' in something not a structure or union


Create a new paste based on this one


Comments: