Path: utzoo!mnetor!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: arrays... Message-ID: <274@sdrc.UUCP> Date: 4 May 88 01:05:49 GMT References: <5773@sigi.Colorado.EDU> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 19 Summary: Problems with array constants In article <5773@sigi.Colorado.EDU>, swarbric@tramp.Colorado.EDU (Frank Swarbrick) writes: > Is there some reason why you can do: > int ary[] = {1,2,3,4}; > foo(ary); > but you can't do > foo({1,2,3,4}); Yep, there's quite a good reason -- just what is {1,2,3,4} supposed to be? An array of ints? An array of chars? Could even be an array of floats or doubles! If the compiler has to see how the thing is being used in order to figure out what it is, it going to be MUCH harder to write, much larger, much slower, and probably much less correct! ---- Larry Jones UUCP: ...!sdrc!scjones SDRC AT&T: (513) 576-2070 2000 Eastman Dr. BIX: ltl Milford, OH 45150 "When all else fails, read the directions."