0

Hello everyone,

I'm working on a project which I should read from a text file. Text file contains two lines of sequational numbers, something like this:
[TEX]
4 5 2 1 10 8
3 4 6 1
[/TEX]

In the program, I need to find out where exactly a new line begins (after 8 in the example). I've heard of '\n' character but not sure how to use it for this purpose.

I thought something like that:

char num[5];
while(!feof(text))
{
fscanf(text,"%s",%num);
if(

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by shadow_shooter
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.