#pragma sizeof

From RAD Studio
Jump to: navigation, search

Go Up to Pragma Directives Overview Index


Syntax (See Pseudo-grammar)

#pragma sizeof( [{ struct | class | union }] SYM )

Description

#pragma sizeof prints the size of the aggregate.

Example

Source file

file.cpp
struct X {
};
#pragma sizeof(X)

// ...

Command line

> bcc32 -c file.cpp

Compiler output

The size of 'X' is 8 bytes (alignment 8)

Note: To see what #pragma sizeof prints in the IDE (in the Messages View), the following options must be set:

See also