Hey there, I'm trying to read in sourcelines from a file and save them to an array. I want to skip any lines that contain only whitespace first though. Here's what I've got so far but I get an incompatible pointer type error. I always have issues with pointers lol
Code:
/* Pre-Processor Directives */
#include <stdio.h>
#include <string.h>
#include "cop3601.h"
extern char sourcelist[][81];
int getsource(char filename[])
{
int lines = 0;
char ws[] = " \t";
FILE *pFile;
if((pFile = fopen(filename,"r")) != NULL)
{
fgets(sourcelist, 81, pFile);
strtok(sourcelist, "\n");
}
else
hprintf("\nFile %s does not exist.\n\n");
fclose(pFile);
return lines;
}
I'm sure it's something really simple that I'm screwing up, but any ideas are helpful!