How can I read multiple lines from a txt file if I want to store the data in different variables? Each line contain the same data type order: int string string char string, separated with tabs.
For example a line in the txt file look like:
11 \t I would like an apple \t What is your favourite car brand? \t b \t elephant
Thanks for help in advance.
I tried to read it with fscanf(“%d\t%s\t%s\t%c\t%s\n”,..); but I can’t read the strings because %s cut my sentence at the first space and it reads only the first line, I can’t move to the next lines.