SilverScreen Solid Modeler

sizeof

sizeof

Previous topic Next topic  

sizeof

Previous topic Next topic JavaScript is required for the print function  

 

StandardCLibrary

 

size_t sizeof ( type-name )

 

type-name   // A type specifier

 

 

 




Synopsis

#include "stddef.h"

 

The sizeof operator gives the amount of storage, in bytes, of an object of the type type-name.

 

 

Parameters

type-name is a type specifier

 

 

Return Value

sizeof returns the number of bytes of storage required by the data type specified by type-name

 

 

See Also

malloc, calloc

 

 

Example

The following code calculates the size of a double and reports it in a message:

C / C++ Code

 

 #include "silver.h

 

 . . .

 

 size_t dbl_size;

 

 dbl_size = sizeof(double);

 

 error_message("A double requires %d bytes of storage", dbl_size);