Xref: utzoo comp.lang.c:29315 comp.lang.c++:7884 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!umich!umeecs!sparky.eecs.umich.edu!bagchi From: bagchi@sparky.eecs.umich.edu (Ranjan Bagchi) Newsgroups: comp.lang.c,comp.lang.c++ Subject: passing arrays to functions Message-ID: <2491@zipeecs.umich.edu> Date: 3 Jun 90 19:14:54 GMT Sender: news@zip.eecs.umich.edu Reply-To: bagchi@sparky.eecs.umich.edu (Ranjan Bagchi) Organization: University of Michigan EECS Dept., Ann Arbor, MI Lines: 23 I would like to pass an array to a function, foo(bar *a[]). Currently, I pass the array by first declaring it... bar *a[] = {bar *a,bar *b,bar *c,bar *d}; ...and then passing it to foo(bar *a[]) with foo(a). What I would like to be able to do is avoid the first step and just do a ... foo({bar *a,bar *b,bar *c,bar *d}); Simply because foo is an initialization routine, and I really have no use for a (as defined about 10 lines up) elsewhere in the program. Anyway, is there any way to get past the compiler complaints, and manage to do something in a form like this? E-mail please, as I don't read this group regularly... -rj bagchi@eecs.umich.edu