SIZEOF - Get the nb of bytes of a variable

Language reference ›› Built-in functions ›› Miscellaneous ››
Parent Previous Next

SIZEOF(identifier)

Returns the total number of bytes used by a constant string / array or variable in memory (RAM, EEPROM or CODE for literal arrays or strings).


For simple boolean types, the function returns 1 and a warning is generated since a bit occupies only one bit.


For literal strings and arrays, SIZEOF returns the number of logical bytes as for a RAM / EEPROM variable, not the number of bytes physically used in the CODE memory, even if the literal is not generated in code segment, due to optimization.