Complete.Org: Mailing Lists: Archives: linux-help: June 2002:
[linux-help] Problem with C program
Home

[linux-help] Problem with C program

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Problem with C program
From: bruce <bbales@xxxxxxx>
Date: Wed, 5 Jun 2002 20:58:18 -0500
Reply-to: linux-help@xxxxxxxxx

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


[Prev in Thread] Current Thread [Next in Thread]