Professional Documents
Culture Documents
An Example of How To Use Struct, Pointer and Loops in C Language
An Example of How To Use Struct, Pointer and Loops in C Language
h>
#include <conio.h>
#define maxstudents 3
struct students
{
char rollno[maxstudents][20],
name[maxstudents][20];
int marks[maxstudents][1];
};
}
}
printf("--------------STUDENTS TABLE---------------------\n" );
printf("S.No: \tRoll No: \tName: \t\tMarks:\n" );
for(i=0; i<maxstudents; i++ )
{
printf("%d. \t%s \t%s \t\t",i+1, s->rollno[i], s->name[i]);
for(j=0; j<1; j++)
{
printf("%d\n", s->marks[i][j] );
}
}
}
main()
{
struct students s;