I'm trying to read some strings from a txt file. Each line has a 5 digit number, a full name that occupies 51 characters (including spaces), 2 city names, each one occupyng 11 characters including spaces, and one number. Example:
12345António Manuel Silva Mendes Frankfurt Varsovia 1
I can now scan the first 2 strings, but I can't scan the city names, nor the last number.
Here's the struct:
typedef struct bilhete{
int BI;
char nome[51];
char partida[11];
char chegada[11];
int data[2];
}BILHETE;
here's the way I'm reading the file
while(!feof(fp)){
fscanf(fp,"%d%51[^\n]s%11c%11c%d\n", &bilhete.BI, bilhete.nome, bilhete.partida, bilhete.chegada, &bilhete.data);
What am I doing wrong? when I print the city names, nothing appears!