#include <stdio.h>
#define BUFSZ 255
struct lala
{
char name[BUFSZ];
unsigned age; // for example :-)
} student[10];
int main(void)
{
for(int i=0; i < 10; i++)
scanf("%s %d", &student[i].name, &student[i].age);
// Using scanf() for reading strings is in general not a good idea.
// Look at fgets(). It is more precise and can prevent overflows.
return 0;
}
<< moderator edit: added [code][/code] tags >>
freemind
Junior Poster in Training
62 posts since Jun 2005
Reputation Points: 10
Solved Threads: 1
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314