7

C++ Program to Find the Size of int, float, double and char

 2 years ago
source link: https://www.geeksforgeeks.org/videos/c-program-to-find-the-size-of-int-float-double-and-char/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

C++ Program to Find the Size of int, float, double and char

C++ Program to Find the Size of int, float, double and char
  • 20 Views
  • 07/06/2022

In this video, we will see a C++ program to find the size of int, float, double, and char.

To find the size of the four variables:

1. The four types of variables are defined in integerType, floatType, doubleType and charType. 2. sizeof() operator is used to calculate the size of the variables. Sizeof is an important operator in the C and C++.

Basically, It is a compile-time unary operator which can be used to compute the size of its operand. The result of sizeof is of the unsigned integral type which is generally denoted by size_t. A sizeof can be applied to any data type, including primitive types like integer types, floating-point types, pointer types, or compound data types such as Structure, union etc. When sizeof() is used with the data types such as int, float, char… etc it simply returns the amount of memory allocated to that data type.

C++ Program to Find Size of int, float, double & char: https://www.geeksforgeeks.org/c-cpp-program-to-find-the-size-of-int-float-double-and-char/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK