Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!amdcad!tim From: tim@amdcad.AMD.COM (Tim Olson) Newsgroups: comp.lang.c Subject: Re: Question about type casting Message-ID: <19994@amdcad.AMD.COM> Date: 17 Jan 88 21:22:55 GMT References: <546@xyzzy.UUCP> <5080012@hpfcdc.HP.COM> Reply-To: tim@amdcad.UUCP (Tim Olson) Organization: Advanced Micro Devices Lines: 30 In article <5080012@hpfcdc.HP.COM> boemker@hpfcdc.HP.COM (Tim Boemker) writes: | > I believe that Standard C does not allow type casting on the left of the | > = sign. | | How about this: | | int i; | char *c; | | c = (char *) &i; | | * (int *) c = 0; | | Are you saying that Standard C doesn't allow c to be recast in that assignment? I believe that the previous poster really meant that C doesn't allow *lvalues* to be cast. In your example, 'c' is not an lvalue, but '*c' is. Therefore, you can write * (int *) c = 0; but not (int)(*c) = 0; -- Tim Olson Advanced Micro Devices (tim@amdcad.amd.com)