I need to write a program that counts up all the semicolons in a function within a file...
I know the algorithm but i'm having trouble putting into code...
What i'm trying to do right now is search through the file for the string "FUNCTION" (which is included in the file to designate the start of the function)
Is this the proper way to do it? or should I use a strcmp function? I get one error from this and it says "too many characters in constant" at the if (str== START) line
Also, if there is no "FUNCTION", how do I proceed to the next line of the file to check again?
#define START 'FUNCTION'
char str, fileName;
printf("Enter file name: ");
fp = fopen(fileName, "r");
printf("%s can not be opened.\n", fileName);
fgets(str, sizeof(str), fp);
if (str == START)
printf("There is a function.");