Hello everyone,
I'm working on a project, each time two numbers are read from a text file. Text file contains two lines of sequational numbers, something like this:
4 5 2 1 10 8
3 4 6 1
I have two linklists and each node is able to store two numbers. First line should be stored in the first linklist, whereas second line in the second one. I should use newline character as a seperator to determine which line goes to which linklist.
I'm stuck at this point because I couldn't find a way to use newline character to change the function so that new numbers will be passed to second linklist's insert function. The following one detects the newline successfully but I couldn't put it into practice.
I'm hopeless and need to submit in 12 hours... Please help me :(
while(!feof(text))
{
fscanf(text,"%d",&num);
fscanf(text,"%d",&num2);
detect=fgetc(text);
if(detect=='\n')
{
printf("New line!");
}
}