🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++
Article #385

Isn't sizeof an operator?

#385
From: Michael Tiemann
Date: Mon, 20 Mar 1989 22:40
18 lines
1070 bytes
   In article <123@riunite.ACA.MCC.COM> rfg@riunite.UUCP (Ron Guilmette) writes:
   ["why isn't sizeof declarable as an operator?"]

   Because it's a compiler directive, not a C-language operator.  The
   result of sizeof (something) is an integer _constant_.  If you try to
   take the size of something that has a varying size, you will get only
   the size of that thing at compile time.

   If you're creating varying-sized data elements, you should keep track of
   their sizes yourself.

				   --Blair
				     "But I don't know why you would..."

It also takes a TYPE as an argument instead of an EXPRESSION.

Michael
Technical Details
Message-ID: <8903202240.AA24954@yahi>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!yahi.stanford.edu!mdt
References: <2352@buengc.BU.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!yahi.stanford.edu!mdt
From: mdt@yahi.stanford.edu (Michael Tiemann)
Newsgroups: gnu.g++
Subject: Isn't sizeof an operator?
Message-ID: <8903202240.AA24954@yahi>
Date: 20 Mar 89 22:40:25 GMT
References: <2352@buengc.BU.EDU>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@lurch.stanford.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 18