Here is input.txt
5
A B C D E
I want to get these characters so I used this code:
//...
int n;
fscanf(fp_i, "%d", &n);
//...
char data;
for (int i = 0; i < n; i++) {
fscanf(fp_i, "%c", &data);
array_c[i] = data;
}
//...
There were still spaces in array_c, so I tried " %c ", and it worked!
I want to learn of another way to get characters with spaces. Is there a more sophisticated way?