The comma operator is used to link related expressions together, allowing multiple variables to be declared and initialized at once, such as int a,c=5,d. The sizeof operator returns the size in bytes of fundamental data types and variables, allowing programmers to determine memory usage for proper allocation. It is a unary operator that can be used to print the size of types like int, float, double, and char.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
94 views1 page
Special Operators
The comma operator is used to link related expressions together, allowing multiple variables to be declared and initialized at once, such as int a,c=5,d. The sizeof operator returns the size in bytes of fundamental data types and variables, allowing programmers to determine memory usage for proper allocation. It is a unary operator that can be used to print the size of types like int, float, double, and char.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Other Operators
Comma Operator Comma operators are used to link related expressions together. For example: int a,c=5,d;
The sizeof operator
It is a unary operator which is used in finding the size of data type, constant, arrays, structure etc. For example: #include <stdio.h> int main(){ int a; float b; double c; char d; printf("Size of int=%d bytes\n",sizeof(a)); printf("Size of float=%d bytes\n",sizeof(b)); printf("Size of double=%d bytes\n",sizeof(c)); printf("Size of char=%d byte\n",sizeof(d)); return 0; }
Output Size of int=4 bytes Size of float=4 bytes Size of double=8 bytes Size of char=1 byte