Article View: comp.std.c
Article #3702Re: 'sizeof e' vs. 'sizeof (T)' (was: Re: Parenthesis with return ?)
From: Thomas Wolf
Date: Fri, 11 Aug 1995 07:12
Date: Fri, 11 Aug 1995 07:12
18 lines
1416 bytes
1416 bytes
In article <sdouglass-1008951104490001@193.131.176.202>, sdouglass@armltd.co.uk (scott douglass) writes: [Snip] :> char c; sizeof c + 1 :> this is '(sizeof c) + 1', i.e. '2'; not 'sizeof (c + 1)', i.e. '1' Due to integral promotion of the char c, the "sizeof (c + 1)" in your example does *not* yield 1. It is equivalent to "sizeof (int)". Regards, Thomas ---------------------------------------------------------------------- Swiss Federal Institute of Technology | Thomas Wolf Software Engineering Laboratory | EPFL-DI-LGL Thomas Wolf (TW) | CH-1015 Lausanne (Suisse) E-Mail: wolf@di.epfl.ch | Phone: (++41 21)693 42 37 ----------------------------------------------------------------------
Technical Details
Message-ID:
<1995Aug11.091041@lglsun.epfl.ch>Path:
arc1-ca.pugleaf.net!dinews.epfl.ch!lglsun!wolfReferences:
<405fhs$iin@boson.epita.fr> <DCy9uG.CEr@proteon.com> <DCz7qw.HvM@stdc.demon.co.uk> <6495221.12652.4448@kcbbs.gen.nz> <sdouglass-1008951104490001@193.131.176.202>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!dinews.epfl.ch!lglsun!wolf From: wolf@lglsun.epfl.ch (Thomas Wolf) Newsgroups: comp.std.c Subject: Re: 'sizeof e' vs. 'sizeof (T)' (was: Re: Parenthesis with return ?) Date: 11 Aug 1995 07:12:51 GMT Organization: Ecole Polytechnique Federale de Lausanne Distribution: world Message-ID: <1995Aug11.091041@lglsun.epfl.ch> References: <405fhs$iin@boson.epita.fr> <DCy9uG.CEr@proteon.com> <DCz7qw.HvM@stdc.demon.co.uk> <6495221.12652.4448@kcbbs.gen.nz> <sdouglass-1008951104490001@193.131.176.202> NNTP-Posting-Host: lglsun2.epfl.ch Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit