Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!lll-winken!sun-barr!newstop!exodus!bike2work.Eng.Sun.COM!bm From: bm@bike2work.Eng.Sun.COM (Bill(Francis) Michel) Newsgroups: comp.unix.questions Subject: Passing arrays of strings Message-ID: <11030@exodus.Eng.Sun.COM> Date: 4 Apr 91 01:04:34 GMT Sender: news@exodus.Eng.Sun.COM Reply-To: bm@bike2work.Eng.Sun.COM (Bill(Francis) Michel) Distribution: ca Organization: Sun Microsystems, Inc. Mt. View, Ca. Lines: 50 /* Help! I'm trying to intialize an array and pass it to a function, massage it. What's wrong with this picture? Thanks Bill */ #include blop (instring, thearray) char *instring; char (*thearray)[]; { int i; for (i=0; i<10; i++) { printf ("%s\n",thearray++); } } main (argc, argv) int argc; char *argv[]; { char myarray[10][ARRAY_LEN] ={{ "blop0"}, { "blop1"}, { "blop2"}, { "blop3"}, { "blop4"}, { "blop5"}, { "blop6"}, { "blop7"}, { "blop8"}, { "blop9"}}; int i; blop(argv[1], myarray); } -- Bill Michel bm@eng.sun.com These views are my own, not Sun's.