Search
 
SCRIPT & CODE EXAMPLE
 

CPP

climits in cpp

// #include <climits>

{
    int Year = 2022;
    char tech = 'y';
    bool BiggerThan32 = 't';
    float AvaRageGrade = 4.5;
    double balance = 13425346576876;
    cout << "Size of int is "<<sizeof(int) <<"bytes
";
    cout << "int max value is "<< INT_MAX << endl;
    cout << "int min value is " << INT_MIN << endl;
    cout << "size of unsigned int "<<sizeof(unsigned int) <<"bytes
";
    cout << "Uint max value is " << UINT_MAX << endl;
    cout << "Size of bool is "<< sizeof(bool) <<"bytes
";
    cout << "Size of char is " << sizeof(char) <<"bytes
";
    cout << "size of float is " << sizeof(float)<<"bytes
";
    cout <<"size of double is"<<sizeof(double)<< "bytes
";
    
    return 0;
}

//RESULT 
// Size of int is 4bytes
// int max value is 2147483647
// int min value is-2147483648 (the 1 bit difference from the max value is coming because of the 0 as it's counted as well.)
// size of unsigned int4bytes
// Uint max value is 4294967295
// Size of bool is 1bytes
// Size of char is 1bytes
// size of float is 4bytes
// size of double is8bytes

// OTHER USES

// CHAR_MIN:- Minimum value for an object of type char. Value of CHAR_MIN is either -127 (-27+1) or less or 0.
// CHAR_MAX:- Minimum value for an object of type char. Value of CHAR_MIN is either -127 (-27+1) or less or 0.
// SHRT_MIN:- Minimum value for an object of type short int. Value of SHRT_MIN is -32767 (-215+1) or less.
// SHRT_MAX:- Maximum value for an object of type short int. Value of SHRT_MAX is 32767 (215-1) or greater.
// USHRT_MAX:- Maximum value for an object of type unsigned short int. Value of USHRT_MAX is 65535 (216-1) or greater.
// INT_MIN:- Minimum value for an object of type int. Value of INT_MIN is -32767 (-215+1) or less.
// INT_MAX:- Maximum value for an object of type int. Value of INT_MAX is 32767 (215-1) or greater.
// UINT_MAX:- Maximum value for an object of type unsigned int. Value of UINT_MAX is 65535 (216-1) or greater.
// LONG_MIN:- Minimum value for an object of type long int. Value of LONG_MIN is -2147483647 (-231+1) or less.
// LONG_MAX:- Maximum value for an object of type long int. Value of LONG_MAX is 2147483647 (231-1) or greater.
// ULONG_MAX:- Maximum value for an object of type unsigned long int. Value of ULONG_MAX is 4294967295 (232-1) or greater.
// LLONG_MIN:- Minimum value for an object of type long long int. Value of LLONG_MIN is -9223372036854775807 (-263+1) or less.
// LLONG_MAX:- Maximum value for an object of type long long int. Value of LLONG_MAX is 9223372036854775807 (263-1) or greater.
// ULLONG_MAX:- Maximum value for an object of type unsigned long long int. Value of ULLONG_MAX is 18446744073709551615 (264-1) or greater.
Comment

PREVIOUS NEXT
Code Example
Cpp :: creator of C++ 
Cpp :: delete 2d dynamic array c++ 
Cpp :: void value not ignored as it ought to be 
Cpp :: c++ default array value not null 
Cpp :: class Solution { public: vector<vector<int threeSum(vector<int& nums) meaning 
Cpp :: what is time complexity of min_element() 
Cpp :: border radius layout android xml 
Cpp :: c++ uniform_real_distribution get same result 
Cpp :: how to get the player view point location and rotation in ue4 c++ 
Cpp :: sqrt cpp 
Cpp :: C++ shortcuts in desktopp app 
Cpp :: quick sort c++ 
Cpp :: convert a int to string c++ 
Cpp :: equal_range in C++ 
Cpp :: function as argument in another function in c++ 
Cpp :: c++ loop through array 
Cpp :: insertion sort c++ 
Cpp :: 2d vector c++ declaration 
Cpp :: getch c++ library 
Cpp :: Unsorted Linked list in c++ 
Cpp :: how to convert int to string c++ 
Cpp :: google pdf iframe viwer 
Cpp :: c++ functions 
Cpp :: c++ initialize array 1 to n 
Cpp :: What should main() return in C++? 
Cpp :: number of words in c++ files 
Cpp :: c++ random number within range 
Cpp :: c++ cout colored output xcode 
Cpp :: Parenthesis Checker using stack in c++ 
Cpp :: coordinate in 1d array 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =