I am currently writing a program to read lines from a .txt file into my C program. So far I can get the program to read the first line but no other ones. Can someone please tell me the command to read more lines as I've searched the internet and i can find anything to help.
This is my program so far...
Code:
#include<stdio.h>
#include <stdlib.h>
void READFILE__B();
char StringStore[50], Line[100];
void main(void)
{
clrscr();
printf("Enter you Name and College Number:\n\n");
scanf("%s",StringStore);
printf("\n");
getch();
READFILE__B();
}
//***************************************************
void READFILE__B()
{
FILE *Data;
Data = fopen("D:\\EXAMC.TXT","r");
fgets(Line, 100, Data);
printf("%s", Line);
getch();
}
//***************************************************
The part where I'm having trouble is the line that says
Code:
printf("%s", Line);
It will read only 1 and i need to read about 4.
Any help would be much appreciated.
Dean