[linux-help] Problem with C program
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I am going through a C tutorial and trying to write a program to pull lines
from a file. The section below is pretty much taken from the tutorial and is
the same in another tutorial. gcc doesn't seem to recognize the word "FILE"
in line 20. Does FILE require some other #include statement?
Lines 20 - 25:
FILE *fptr ; , *fopen();
fptr=fopen("/home/bruce/c-progs/mywords", "r");
if(fptr==NULL)
{printf("Can't open file\n");
exit(-1);
}
[bruce@bertha c-progs]$ gcc jumble.c
jumble.c: In function `main':
jumble.c:20: parse error before `*'
jumble.c:21: `fptr' undeclared (first use in this function)
jumble.c:21: (Each undeclared identifier is reported only once
jumble.c:21: for each function it appears in.)
bruce
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi
- [linux-help] Problem with C program,
bruce <=
|
|