Pejman Moghadam / C-programming

C++ - Size of data types

Public domain


#include <iostream>
using namespace std;
int main()
{
        cout << "bool: "   << sizeof(bool)   << endl;
        cout << "char: "   << sizeof(char)   << endl;
        cout << "short: "  << sizeof(short)  << endl;
        cout << "int: "    << sizeof(int)    << endl;
        cout << "long: "   << sizeof(long)   << endl;
        cout << "float: "  << sizeof(float)  << endl;
        cout << "double: " << sizeof(double) << endl;
        return 0;
}

BY: Pejman Moghadam
TAG: cpp
DATE: 2011-05-28 09:07:59


Pejman Moghadam / C-programming [ TXT ]