Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: pointers to arrays Message-ID: <16036@mimsy.UUCP> Date: 19 Feb 89 22:56:43 GMT References: <19784@uflorida.cis.ufl.EDU> <1042@auspex.UUCP> <19797@uflorida.cis.ufl.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 >> int (*foo)[13]; >> int bar[13]; >> >> foo = &bar; In article <19797@uflorida.cis.ufl.EDU> thoth@beach.cis.ufl.edu (Robert Forsman) writes: >AUUUGH! what happens if you say (*foo) = muck (where muck is int muck[13]) You get an error, just as if you had said bar = muck; The left hand side of an assignment operator is an lvalue context, and an array designator (such as bar or *foo) in an lvalue context is an error. (The other option for the language designer is to say that if an array designator appears on the lhs of an assignment, the rhs must be conformable, and the elements of the arrays are copied. But C will not do that for you.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris