I'm building a program that can read two files from the command line only once but I'm unable to read the other file when I try to read both files I get segmentation error.
char buffer[100], buffer2[100];
while (((fgets(buffer, sizeof(buffer), infp1)) && (fgets(buffer2, sizeof(buffer2), infp2))) != NULL)
{
if(buffer[0] == '#')
continue;
}
basically the above code takes two files when reading the first file and gets to a line with #
it skips over it and continue to the next line.