range of int in cpp code example
Example 1: range of long long in c++
Long
Data Type Size (in bytes) Range
long int 4 -2,147,483,648 to 2,147,483,647
unsigned long int 4 0 to 4,294,967,295
long long int 8 -(2^63) to (2^63)-1
unsigned long long int 8 0 to 18,446,744,073,709,551,615
Example 2: range of int
TypeName Bytes Range of Values
int 4 -2,147,483,648 to 2,147,483,647
Example 3: how to convert int in to const char in c
int size;
char dispsize[100];
sprintf(dispsize,"%d",size);
Example 4: converting char to int in c++
#include
using namespace std;
int main()
{
stringstream str;
str << "1";
double x;
str >> x;
}