training

Kevin Fries kevin at fries-biro.com
Mon Dec 19 15:24:27 MST 2011


On Mon, 2011-12-19 at 15:07 -0700, Michael Havens wrote:
> I might be grren but I did put the '#include<stdlib.h>' in. In fact I
> copied the entire file and it didn't compile.

Not sure what was wrong.

I was able to run your example:

kfries at kfries-laptop:tmp$ cat argexample.c
#include <stdio.h>

int main (int argc, char **argv) {
   int count;
   for (count = 0; count < argc; count++) {
      printf ("argument no %d = %s\n", count, *argv++);
   };

   return 0;
}
kfries at kfries-laptop:tmp$ gcc -o argexample argexample.c
kfries at kfries-laptop:tmp$ ./argexample hello world
argument no 0 = ./argexample
argument no 1 = hello
argument no 2 = world


Hope this helps
Kevin



More information about the PLUG-discuss mailing list