I'm trying to read in lines of text from a file. The line will be formatted in one of three ways. It will either be just a character, a character and one string or a character and two strings. Everything is separated by white space. I am using the command:
I am having an issue when there are three lines with only a single character, it is read in as a single character. Also there is an issue when there is only a character and one string on the line. Can I use a single fscanf() command to read in line of text like this?
int tmp = fscanf(in, " %c %79[^\n]s %79[^\n]s", &code, arg2, arg3);