[ create a new paste ] login | about

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

C, pasted on Jan 12:
#include <stdio.h>
#include <stdlib.h>

typedef  struct {
	char s[100];
	int eng,math;
       }student;
int main(void)
{
int *p, i, n, max;
printf("人数を入力してください: ");
scanf("%d", &n);


p = calloc(n, sizeof(student));
for(i=0; i<n; i++){
	printf("氏名:");
scanf("%s",p[i].s);
}

free(p);
return 0;
}


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


Create a new paste based on this one


Comments: