C problems

Fred Walter grwalter at watmath.waterloo.edu
Wed May 31 03:23:03 AEST 1989


In article <DEVEN.89May30033457 at daniel.rpi.edu> deven at rpi.edu (Deven Corzine) writes:
>In article <May.29.21.40.18.1989.8866 at topaz.rutgers.edu> armhold at topaz.rutgers.edu (George Armhold) writes:
>>  I started using my C compiler today (Manx Aztec V3.6a), and I'm really
>>  frustrated with I/O.

>argc is an integer, but argv is a char **.  You need to add a line
>after main(argc,argv) but BEFORE the "{" which reads "char **argv;" or
>"char *argv[];" (take your pick; they mean the same.) and you *should*
>add right before it "int argc;"

As well, the following code segment has a problem...

  	while ((c=getc(fp1)!=EOF)) 
  		putc(fp2);
                ^^^^^^^^^^

You really want to be using putc(c, fp2). (Not to mention adding spaces
would increase the readability of your code IMHO).

	fred



More information about the Comp.lang.c mailing list