Answers for "how to get the size of an integer c++"

C++
0

how to find size of int in c++

#include <iostream>
using namespace std;

int main(){    
    cout << "Size of char: " << sizeof(char) << " byte" << endl;
    cout << "Size of int: " << sizeof(int) << " bytes" << endl;
    cout << "Size of float: " << sizeof(float) << " bytes" << endl;
    cout << "Size of double: " << sizeof(double) << " bytes" << endl;

    return 0;
}
Posted by: Guest on March-19-2022
0

c++ length of int

unsigned int number_of_digits = 0;

do {
     ++number_of_digits; 
     n /= base;
} while (n);
Posted by: Guest on September-10-2020

Code answers related to "how to get the size of an integer c++"

Browse Popular Code Answers by Language