printf("Batch Mode\n");
FILE* batchFile;
char oneLine[LINE_MAX];
batchFile = fopen(argv[1], "r");
bool done = false;
if(batchFile == NULL)
{
perror("File");
exit(1);
}
while (fgets(oneLine,LIMIT,batchFile) != NULL && !done)
{
processLine(oneLine, done);
}
So I have some concern regarding my code above. The problem is fgets still gets lines even if the lines just contain a newline character. So I need to eliminate this or at least be able to check for lines that contain only a newline.
I tried
if (strcpy(line, '\n') == 0)
{
printf("an Enter key line\n");
return;
}
But still it doesn't work.