Answers for "how to find the size of variable in c++"

C++
0

how to find data size in c++

cout << "Size of char: " << sizeof(variable) << " byte(s)" << endl;
Posted by: Guest on May-30-2021
1

C++ SizeOf

cout << "The sizeof(char) is " << sizeof(char) << " byte/s" << endl;
    cout << "The sizeof(short) is " << sizeof(short) << " byte/s" << endl;
    cout << "The sizeof(int) is " << sizeof(int) << " byte/s" << endl;
    cout << "The sizeof(long) is " << sizeof(long) << " byte/s" << endl;
    cout << "The sizeof(long long) is " << sizeof(long long) << " byte/s" << endl;
    cout << "The sizeof(float) is " << sizeof(float) << " byte/s" << endl;
    cout << "The sizeof(double) is " << sizeof(double) << " byte/s" << endl;
    cout << "The sizeof(long double) is " << sizeof(long double) << " byte/s" << endl;
    cout << "The sizeof(bool) is " << sizeof(bool) << " byte/s" << endl;
Posted by: Guest on March-09-2022

Code answers related to "how to find the size of variable in c++"

Browse Popular Code Answers by Language