Je veux prendre des informations d'une classe qui contient le nom de l'élève, n ° de rouleau. et l'imprimer je structure, mais le code ne fonctionne pasun tableau qui prend plusieurs éléments de type de données différent
#include<stdio.h>
#include <string.h>
int size,i,j;
struct Student
{
char name[50];
int number;
};
typedef struct Student info1;
info1 print[100];
int main()
{
printf("Size of class : ");
scanf("%d",&size);
for(j=0;j<(20);)
{
for(i=1;i<=size;i++)
{
printf("%d.Name:",i);
scanf("%s",&info1.name);// i get an error here that an exp is expected
print[j]=info1.name; // i get an error here that an exp is expected
j++;
printf("Rollno:");
scanf("%d", &info1.number);// i get an error here that an exp is expected
print[j]=info1.number;// i get an error here that an exp is expected
}
}
for (j = 0;j <(20);)
{
printf("%s Name", print[j]);
j++;
printf("%d Rollno", print[j]);
}
return 0;
}
pendant le débogage je reçois les erreurs suivantes:
exp attendue avant info1