Search
 
SCRIPT & CODE EXAMPLE
 

CPP

C++ Program to Find the Range of Data Types using Macro Constants

// C++ program to sizes of data types
#include <iostream>
#include <limits.h>
using namespace std;
 
int main()
{
    cout << "Size of char : " << sizeof(char) << " byte"
         << endl;
   
  cout << "char minimum value: " << CHAR_MIN << endl;
   
   
  cout << "char maximum value: " << CHAR_MAX << endl;
   
   
  cout << "Size of int : " << sizeof(int) << " bytes"
         << endl;
     
  cout << "Size of short int : " << sizeof(short int)
         << " bytes" << endl;
     
  cout << "Size of long int : " << sizeof(long int)
         << " bytes" << endl;
     
  cout << "Size of signed long int : "
         << sizeof(signed long int) << " bytes" << endl;
     
  cout << "Size of unsigned long int : "
         << sizeof(unsigned long int) << " bytes" << endl;
     
  cout << "Size of float : " << sizeof(float) << " bytes"
         << endl;
    
  cout << "Size of double : " << sizeof(double)
         << " bytes" << endl;
     
  cout << "Size of wchar_t : " << sizeof(wchar_t)
         << " bytes" << endl;
 
    return 0;
}
Comment

C++ Program to Find the Range of Data Types using Macro Constants

// C++ program to sizes of data types
#include <iostream>
#include <limits.h>
using namespace std;
 
int main()
{
    cout << "Size of char : " << sizeof(char) << " byte"
         << endl;
   
  cout << "char minimum value: " << CHAR_MIN << endl;
   
   
  cout << "char maximum value: " << CHAR_MAX << endl;
   
   
  cout << "Size of int : " << sizeof(int) << " bytes"
         << endl;
     
  cout << "Size of short int : " << sizeof(short int)
         << " bytes" << endl;
     
  cout << "Size of long int : " << sizeof(long int)
         << " bytes" << endl;
     
  cout << "Size of signed long int : "
         << sizeof(signed long int) << " bytes" << endl;
     
  cout << "Size of unsigned long int : "
         << sizeof(unsigned long int) << " bytes" << endl;
     
  cout << "Size of float : " << sizeof(float) << " bytes"
         << endl;
    
  cout << "Size of double : " << sizeof(double)
         << " bytes" << endl;
     
  cout << "Size of wchar_t : " << sizeof(wchar_t)
         << " bytes" << endl;
 
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to check if vector is ordered c++ 
Cpp :: cpp ignore warning in line 
Cpp :: c++ multiply char 
Cpp :: Find duplicates in an array geeks for geeks solution in cpp 
Cpp :: if argv == string 
Cpp :: c++ regex count number of matches 
Cpp :: c++ json parser euc-kr 
Cpp :: balanced parentheses 
Cpp :: sliding window c++ 
Cpp :: ImGui button wit picture 
Cpp :: Basic Input / Output in C++ 
Cpp :: vectors in c++ 
Cpp :: count number of char in a string c++ 
Cpp :: backtrack 
Cpp :: Converting Strings to Numbers in C/C++ 
Cpp :: __builtin_popcount long long 
Cpp :: C++ float and double Using setprecision() For Floating-Point Numbers 
Cpp :: transpose matrix c++ vectors 
Cpp :: array of charcter c++ 
Cpp :: Array Rotate in c++ 
Cpp :: C++ switch..case Statement 
Cpp :: unordered_map in c++ 
Cpp :: c++ square and multiply algorithm 
Cpp :: how atan work c++ 
Cpp :: error: use of parameter outside function body before ] token c++ 
Cpp :: C++ Initializing a thread with a class/object 
Cpp :: how you can add intger value to string in c++ 
Cpp :: c++ bind port 
Cpp :: check .h files syntax c++ 
Cpp :: gcd multi num 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =