Hi all.
this is part of my code
Code:
FILE *fp;
fp = fopen("test.txt", "w");
system ("cls");
printf("How many employee info do you wish to enter? ");
scanf("%d", &empNum);
for(counter = 0; counter < stuNum; counter++)
{
fprintf(stdout, "\nEnter Employee name: ");
fscanf(stdin,"%s", s1[counter].name);
fprintf(stdout, "Enter Salary: ");
fscanf(stdin,"%d", &s1[counter].salary);
fprintf(fp, "%s%d", s1[counter].name,
s1[counter].salary);
fclose(fp);
}
when i checked the *.txt file it only hav one input (even if i entered 10 input). can u help me with this ??