I have a file of strings seperated by space and I want to get those strings into an array of defined type but I get an error saying that fscanf doesn't take char**, does anyone know how to do this please?
typedef struct{
char *string;
int name;
} DBZ;
DBZ Table[100];
fp = fopen("text.txt", "r");
if(fp == NULL)
{
fprintf(stderr, "Error opening file.");
exit(1);
}
else {
int i=0;
while(!feof(fp))
{
fscanf(fp,"%s", &Table[i].string);
i++;
}
}