Re: I have a problem in my study
- From: "Herbert Rosenau" <os2guy@xxxxxxxxxxxxx>
- Date: Tue, 31 Oct 2006 10:29:20 +0000 (UTC)
On Mon, 30 Oct 2006 23:03:44 UTC, Mark McIntyre
<markmcintyre@xxxxxxxxxxx> wrote:
On 30 Oct 2006 01:54:09 -0800, in comp.lang.c , qazwsx746@xxxxxxxx
wrote:
I use operating systems of windows xp ,
and compiler is trubo c 3.0
when I input data,the following program can't be exited.
what happen to this program?
Is the wrong with the compiler?
#include <stdio.h>
main(int argc,char *argv[])
{ FILE *fp;
void filecopy(FILE *,FILE *);
its normal to declare function prototypes outside main. C doesn't have
the idea of local function definitions.
No. It is normal to declare a prototype where it gets used. That
includes it inside a function.
Yes, you would declare all prototypes outside any function - but when
you are sure that you needs it only inside one function it can be a
good idea to hide that from any else.
while ((c=getc(ifp))!=EOF)
how do you signal EOF? Remember, its not a character, its a signal.
Hey, the OP had declared c as int - and getc() does not return char
but int. Read your book what getc returns - an char wided to int or
EOF.
--
Tschau/Bye
Herbert
Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
.
- Follow-Ups:
- Re: I have a problem in my study
- From: Richard Heathfield
- Re: I have a problem in my study
- References:
- I have a problem in my study
- From: qazwsx746
- Re: I have a problem in my study
- From: Mark McIntyre
- I have a problem in my study
- Prev by Date: Re: not writing to file
- Next by Date: Re: finding how much the file system is full, from a C program?
- Previous by thread: Re: I have a problem in my study
- Next by thread: Re: I have a problem in my study
- Index(es):
Relevant Pages
|
|