#pragma sizeof
Go Up to Pragma Directives Overview Index
Contents
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:
- Set Verbosity = Normal on Tools > Options > Environment Options.
- Set Show general messages = true on Tools > Options > Environment Options > C++ Options > Project Properties.
See also
- SizeOf (in Delphi)