Xref: utzoo comp.sys.amiga:34570 comp.lang.c:19029 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!aramis.rutgers.edu!topaz.rutgers.edu!armhold From: armhold@topaz.rutgers.edu (George Armhold) Newsgroups: comp.sys.amiga,comp.lang.c Subject: C problems Keywords: Amiga, Manx 3.6a Message-ID: Date: 30 May 89 01:40:23 GMT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 38 I started using my C compiler today (Manx Aztec V3.6a), and I'm really frustrated with I/O. I have the K&R book, _Understanding C_ by Bruce Hunter, as well as the documentation that came with Manx. All three of them left me bewildered with the various file I/O conventions. There's open, fopen, creat, etc... Which do I use when? What about writing to the console? Can anyone recommend a GOOD book that explains the various methods of I/O and also points out differences between "standard" and "machine specific"? Also, here's some source I tried today. What I'm trying to do is simply copy one file to another. When I compile it, I get error 125 which means "too many subscripts or indirection on integer". It occurs wherever I mention argv[x]. #include main(argc, argv) { int c; FILE *fp1, *fp2; if ((fp1=fopen(argv[1], "r"))==NULL) { printf("Can't open %s", argv[1]); exit(); } if ((fp2=fopen(argv[2], "w"))==NULL) { printf("Can't open %s", argv[2]); exit(); } while ((c=getc(fp1)!=EOF)) putc(fp2); } Thanks -George