Re: program bug
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Fri, 02 May 2008 18:47:28 -0400
Bill Cunningham wrote:
"Robert Gamble" <rgamble99@xxxxxxxxx> wrote in message
a is not initialized, referencing its value invokes undefined
behavior.
a=fgetc(ifp);
fputc(a,ofp);
In the beginning a was declared. Is it not enough in this case to
simply declare an int? Or should I have done this int a=0; at the
beginning of the program?
You are using it before loading it. You want:
while (EOF != (a = fgetc(ifp))) fputc(a, ofp);
Note the use of blanks. As I recall there are other errors also.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
.
- References:
- program bug
- From: Bill Cunningham
- Re: program bug
- From: Robert Gamble
- Re: program bug
- From: Bill Cunningham
- program bug
- Prev by Date: Re: Reverse and print a string
- Next by Date: Re: program bug
- Previous by thread: Re: program bug
- Next by thread: Re: program bug
- Index(es):
Relevant Pages
|