Dear all,
I met a problem about using "fscanf_s" to read string "&1&2" from the file "A.txt". The snippet of the code is described as follows,
char first[5];
char second[5];
int number1 = 0;
int number2 = 0;
err = fopen_s(&fp_t, "c://A.txt", "r");
fscanf_s(fp_t, "%s%d%s%d", first, number1, second, number2);
While the problem is after the above "fscanf_s" is executed, the values of first, number1, second, number2 are not changed, by which means the program fails in reading data. The ideal result should be first[0] = "&", second[0] = "&", number1 = 1, number2 = 2.
Thereby, can you help me a little bit?
Thanks in advance,
Bests,
Qing