Xref: utzoo comp.sys.amiga:34584 comp.lang.c:19035 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!indri!csd4.milw.wisc.edu!leah!rpi!rpi.edu!deven From: deven@rpi.edu (Deven Corzine) Newsgroups: comp.sys.amiga,comp.lang.c Subject: Re: C problems Message-ID: Date: 30 May 89 07:34:57 GMT References: Sender: usenet@rpi.edu Organization: RPI Public Access Workstation Lab, Troy NY Lines: 34 In-reply-to: armhold@topaz.rutgers.edu's message of 30 May 89 01:40:23 GMT In article armhold@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. Poor guy... you'll surely be baffled by Amiga Exec I/O... 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) { [...] This error has nothing to do with the I/O; you never declared what the parameters rto main were, so the compiler assumed integer for both. 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;" but you don't need to, since the compiler will assume it. It thought argv was an integer, and argv[x] was the indirection on integer causing the error. Deven -- shadow@[128.113.10.2] Deven T. Corzine (518) 272-5847 shadow@[128.113.10.201] 2346 15th St. Pi-Rho America deven@rpitsmts.bitnet Troy, NY 12180-2306 <> "Simple things should be simple and complex things should be possible." - A.K.