Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: sizeof() confusion Message-ID: <14462@smoke.brl.mil> Date: 15 Nov 90 18:17:53 GMT References: <2665@cirrusl.UUCP> <2692@cirrusl.UUCP> <1990Nov14.154213.27324@cbnewsj.att.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 20 In article <1990Nov14.154213.27324@cbnewsj.att.com> asd@cbnewsj.att.com (Adam S. Denton) writes: >You take sizeof() of an object, not an expression. Not so; there are two distinct uses of sizeof: sizeof unary_expression sizeof ( type_name ) The former does operate on an expression; however the expression is not evaluated (so no side effects occur), only the type of the expression is relevant. A particularly simple form of unary expression consists of just the identifier for an object, but more complex expressions are permitted. >Your [dhesi's] view is nice, but is not C. >[...] >It is the responsibility of the programmer to know the language >and use it properly, whether the language is perfect or not. Now that you got right.