Size of Compile-Time Operator Assignment Help

Assignment Help: >> Data Types, Variables and Operators in C++ - Size of Compile-Time Operator

Size of Compile-time Operator

Size of is a unary compile-time operator which returns the length of the operand, in bytes. The operand could be a variable that should be a constant or a data type.

Example:

#include <iostream.h>

main()

{

char ch;

cout<<sizeof ch;

cout<<sizeof(int);

}

The output is:

12

Note, to compute the size of a type, you have to enclose the type name in parentheses. This is not must for variable names. Size of operator is generally used to determine the lengths of arrays and structures whenever their sizes are not known to the programmer.  That  is  also  used  to  allocate  dynamic  memory  to  variables  in during execution of the program.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd