Gentee Programming Language > Documentation > Syntax Download documentation

sizeof Operator

The sizeof operator is used to get the amount of storage in bytes needed for an object. The sizeof operator takes a single argument, the type name to be specified.

<sizeof> ::= sizeof '(' (<type name> | <expression>) ')'

The sizeof operator returns the size of the specified type.

type mystuct {
   uint a, b
   byte c
}
...
sizeof( uint ) // = 4
sizeof( byte ) // = 1
sizeof( mystruct ) // = 9

See also

    Table Of Operator Precedence


 Copyright © 2004-2006 Gentee Inc. All rights reserved.