[LC++]sizeof...

ianezz at kinsale.sodalia.it ianezz at kinsale.sodalia.it
Mon Aug 5 22:56:08 UTC 2002


Goverthanan, pigiando tasti a caso sul citofono, ha scritto:

 > Can anyone tell me whats the alternative for sizeof function i can
 > use to get the size of the variable...

sizeof() is an operator of the language, not a function, and unless
you know in advance how many bytes a certain type requires, there's no
way around it (i.e. only the compiler knows -- this is true expecially
for structs and classes).

May I ask you why are you trying to avoid using sizeof()?

-- 
 |   \    \  | ___|_  |_  | ianezz AT sodalia.it
 |  _ \  | \ | _|    /   /  Visita il LinuxTrent a
_|_/  _\_|  _|____|___|___| http://www.linuxtrent.it




More information about the tuxCPProgramming mailing list