Thursday, January 5, 2012

Size and range of integer; INT, SHORT, LONG and LONGLONG

Size and range of integer; INT, SHORT, LONG and LONGLONG

It's tested under Windows 8 (Developer Preview) and Visual Studio 11 Developer Preview.
Size and range of integer; INT, SHORT, LONG and LONGLONG
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{

 cout << "_INT_SIZE: " << _INT_SIZE << endl;
 cout << "INT_MIN= " << INT_MIN << endl;
 cout << "INT_MAX= " << INT_MAX << endl << endl;

 cout << "_SHORT_SIZE: " << _SHORT_SIZE << endl;
 cout << "SHRT_MIN= " << SHRT_MIN << endl;
 cout << "SHRT_MAX= " << SHRT_MAX << endl;
 cout << "USHRT_MAX= " << USHRT_MAX << endl << endl;

 cout << "_LONG_SIZE: " << _LONG_SIZE << endl;
 cout << "LONG_MIN= " << LONG_MIN << endl;
 cout << "LONG_MAX= " << LONG_MAX << endl;
 cout << "ULONG_MAX" << ULONG_MAX << endl << endl;

 cout << "_LONGLONG_SIZE: " << _LONGLONG_SIZE << endl;
 cout << "LLONG_MIN= " << LLONG_MIN << endl;
 cout << "LLONG_MAX= " << LLONG_MAX << endl;
 cout << "ULLONG_MAX= " << ULLONG_MAX << endl << endl;

 system("PAUSE");
 return 0;
}


No comments:

Post a Comment