Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ datatype size

// Following is the example, which will produce correct size of various data types on your computer.
  
#include <iostream>
using namespace std;
  
int main() 
{
    cout << "Size of char : " << sizeof(char) << endl;
    cout << "Size of int : " << sizeof(int) << endl;
      
    cout << "Size of long : " << sizeof(long) << endl;
    cout << "Size of float : " << sizeof(float) << endl;
      
    cout << "Size of double : " << sizeof(double) << endl;
      
      return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #datatype #size
ADD COMMENT
Topic
Name
7+6 =