Code:
#include <stdio.h>
#include <stdlib.h>
int main(void){
FILE* infile;
char name[81];
int age;
printf("Please type your age:\n");
scanf("%d", age);
printf("Please type your name:\n");
scanf("%s", name);
infile=fopen("lala(exersice_no_1).txt","r");
if(infile==NULL){
printf("File didn' found!");
exit(1);
}
while(fscanf(infile,"%s %d", name, &age)!=EOF){
?
}
return 0;
}
Hi guys...
i have a file that contains:
Billys 20
and i want to print them using the above code but i don' t know what to put insteed of the questionmark. I want to "save" them into the 2 variables but this "job" is already end in the code that i did.