Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!gatech!seismo!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: Re: type cast in initializer Message-ID: <691@brl-smoke.ARPA> Date: Thu, 6-Feb-86 18:30:45 EST Article-I.D.: brl-smok.691 Posted: Thu Feb 6 18:30:45 1986 Date-Received: Tue, 11-Feb-86 04:28:21 EST References: <302@hsi.UUCP> <1450@bbncc5.UUCP> <305@cray.UUCP> Reply-To: gwyn@brl.ARPA Organization: Ballistic Research Lab Lines: 14 >> > int x = 0; >> > char *ptr = (char *) &x; >> >> In any case, I'm not sure why you'd want to do what your example does, >> since the cast here is a no-op. > >An int pointer does not necessarily have the same format as a char pointer. >Consider a word addressible machine on which the char's are packed into the >words. But, the = forces the same type coercion as the type cast. Writing the cast explicitly is good style, however. I don't see why the fellow wants to do what he's doing quite apart from the question of how to express it..