answersLogoWhite

0

size of operater - is used to print the size in byte of your data types such as(int, char, float, double etc.) depend upon your different types of data types. and compilers

EXAMPLES

#include

#include

int main()

{

int i;

char ch;

float f;

double d;

long double l;

printf("\nsize of integer is %d byte",sizeof(i));

printf("\nsize of character is %d byte",sizeof(ch));

printf("\nsize of float is %d byte",sizeof(f));

printf("\nsize of double is %d byte",sizeof(d));

printf("\nsize of long is %d byte",sizeof(l));

getch();

}

Made by (ARUN KUMAR RAI).

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Sizeof operator to determine the memory occupied by structure variables and pointers?

C and C++ both include the built-in sizeof() operator to do just that.


Explain the role of sizeof operator in java?

There is no sizeOf() operator in Java.


Which operator works like sizeof operator in Java?

Java does not have the sizeOf() operator or any operator that gives an equivalent result.


Which is dummy operator in c?

unary + is the only dummy operator in c,...


What is size of operator in c language?

it is used to know the memory size of variable of data type. Ex: float a; printf ("sizeof (a)= %d\n", sizeof (a)); or: printf ("sizeof (float)= %d\n", sizeof (float));


What are special operators in c plus plus?

The only "special" operators in C++ are those that cannot be overloaded. That is; the dot member operator (.), pointer to member operator (.*), ternary conditional operator (:?), scope resolution operator (::), sizeof() and typeof().


What is the use of 'size of' in c programming?

The sizeof operator is used to determine the length of its operand (in bytes). The operand must be a type or an object of a type (a variable). The operator is a constant expression and therefore executes at compile time. As such there is no runtime overhead in repeated use of the sizeof operator.


Is sizeof an operator or function why?

You cannot overload the sizeof() operator because that could introduce uncertainty in its evaluation. The sizeof() operator must always produce an accurate and logically predictable result, thus all user-intervention is completely forbidden.


Can array size be determined using sizeof operator in c?

Yes. The array name is a reference to the array, so you can use sizeof (name) / sizeof (name[0]) to determine the number of elements. Note that sizeof (name) alone gives the length of the array in bytes.


Which c plus plus operators cannot be overloaded?

1. Member-of operator (.) 2. Pointer-to-member-of operator (.*) 3. Ternary condition operator (?:) 4. Scope resolution operator (::) 5. sizeof operator 6. typeid operator


Why you call sizeof is a operator not a function in c language?

If sizeof were a function, the following code would work (you can try with any other function):printf ("Function sizeof is located at %p", sizeof);On the other hand, the following code wouldn't work, as functions don't accept a type as parameter:size_t intsize= sizeof (int);


What does of size of operator do?

The sizeof() operator returns the number of bytes allocated to the operand.