Help with scanning in strings
Hey guys im having some trouble scanning in a few strings from a text file.
Here is a sample of the text file:
Command number1
Command2 number2 number3
Command3 number4 number5
Command4 number6
Here is my code for this part of the program
Code:
fscanf(data,"%s%s%s",&inCommand, &inOperand1, &inOperand2);
printf( "%s %s %s \n",inCommand, inOperand1, inOperand2);
How do I make it skip to the next line when it reaches EOL.
So it scans in Command, number1 , and EOL on the first time around. And if the command has two numbers scan in both on the second time around.
Thanks
Chris