TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Jasen Betts
date: 2003-08-09 18:24:20
subject: sizeof()

Hi Bill.

08-Aug-03 00:36:00, Bill Birrell wrote to Jasen Betts


 BB> Hi Jasen,

  >> Given

  >> typedef struct moo { int foo; char bar; } moo;

  >> is   sizeof(moo) * 100   always the same as   sizeof( moo[100] )

 BB> I think so. I'm not at all sure that moo[100] means anything at
 BB> all unless the array of structures is declared and consequently
 BB> storage is allocated

When you do sizeof(moo) or even sizeof(int) no storage has been
allocated...

lots of people question my use of sizeof(moo[100]) none of my compilers
seem to mind, but I've only got two diffferent brands of compiler.

 -=> Bye <=-

---
* Origin: Don't pay your exorcist & get repossessed! (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.