Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!nosc!manta!psm From: psm@manta.NOSC.MIL (Scot Mcintosh) Newsgroups: comp.lang.c Subject: Casting the lvalue Message-ID: <1025@manta.NOSC.MIL> Date: 6 Mar 90 01:45:19 GMT Reply-To: psm@manta.nosc.mil.UUCP (Scot Mcintosh) Distribution: na Organization: Naval Ocean Systems Center, San Diego Lines: 16 The following seems to be illegal (at least under Microsoft C version 5.1): (int)array[1] = 5; while this appears to be ok: *(int *)&array[1] = 5; Question: why is the first form illegal, and is there a more 'elegant' way than the second form to accomplish the same thing? -- ---- Scot McIntosh Internet: psm@helios.nosc.mil UUCP: {ihnp4,akgua,decvax,decwest,ucbvax}!sdscvax!nosc!psm