Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #size #int
ADD COMMENT
Topic
Name
8+2 =