1
I have the following
while(!feof(f)){
(*ptr).push_back(carro());
fscanf (f, "%d", (*ptr)[add].id);
fscanf (f, "%s", (*ptr)[add].marca);
add++;
}
Where *ptr is &vector, a vector of a car struct, I have already managed to save but for some reason I do not understand the program, when it loads the file, it breaks.
The file, if important, contains:
1 VW
2 Seat
3 Audi
And the struct is as follows:
typedef struct Auto{
int id;
char marca[50];
}carro;
Thank you!