Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!masscomp!miket From: miket@masscomp.UUCP Newsgroups: comp.sys.cbm Subject: Re: C Power problems with argc and argv Message-ID: <1357@masscomp.UUCP> Date: Fri, 23-Jan-87 08:27:58 EST Article-I.D.: masscomp.1357 Posted: Fri Jan 23 08:27:58 1987 Date-Received: Sat, 24-Jan-87 10:47:16 EST References: <2755@ihlpg.UUCP> Reply-To: miket@masscomp.UUCP (Mike Truax) Followup-To: argv & argc problem in C-power Distribution: comp.sys.cbm Organization: MASSCOMP - Westford, Ma Lines: 48 In article <2755@ihlpg.UUCP> cuda@ihlpg.UUCP writes: >I wrote this short program to experiment with argv and argc. >The output is always the same. Argc is zero and argv is >empty (probably because of argc). Has anyone gotten these >things to work? Does anyone know what the command syntax >should be? I have tried both in and out of the shell. > >include "stdio.h" > >main(argc, argv) > >int argc; >char *argv[]; >{ >int i; > printf("argc = %d\n",argc); > printf("argv = "); > for (i=0;iprintf("%s, ",argv[i]); > } >} I'm not familiar with C-power, but all the C compilers that I have used need an " # " in front of the include. There is nothing wrong with the code, mayby the problem isn't with argv & argc, but with the compiler not giving an error when it doesen't have an " # " in front of things like #include, #define, #ifdef etc... Does any one else out there care to comment about this. #include "stdio.h" main(argc, argv) int argc; char *argv[]; { int i; printf("argc = %d\n",argc); printf("argv = "); for (i=0;i