filmov
tv
sizeof operator in C | Find the number of elements in an array with the using sizeof operator

Показать описание
sizeof operator in C
• Sizeof is a much used operator in the C or C++
• It is a compile time unary operator .
• sizeof() operator is used in different way according to the operand type.
• it return the size of a variable.
• It can be applied to any data type int, float char, pointers etc.
Most important point- we can calculate the number of elements in an array with the using sizeof operator.
use of sizeof operator in C and calculate the number of elements in an array.
For example- Number of elements in an array = sizeof(arr)/sizeof(arr[0])
• Sizeof is a much used operator in the C or C++
• It is a compile time unary operator .
• sizeof() operator is used in different way according to the operand type.
• it return the size of a variable.
• It can be applied to any data type int, float char, pointers etc.
Most important point- we can calculate the number of elements in an array with the using sizeof operator.
use of sizeof operator in C and calculate the number of elements in an array.
For example- Number of elements in an array = sizeof(arr)/sizeof(arr[0])