I’m using the fgets function to read a line from a file. I don’t understand how to ignore the leading whitespace of a file though. I thought if I had a char array I could check the first value to see if it is whitespace with isspace, and then increment to the next value. My code looks like:
while (!feof(fp)) {
fgets(str, LINE_SIZE, fp);
while (isspace(*str)) { // need help
str + 1; // here
}
for (cp = str; cp = strtok(cp, "AEIOUaeiou\n"); cp = NULL) {
puts(cp);
}
}
}
Thanks!
what you want is something like