fork download
  1. // Example program
  2. #include <iostream>
  3. #include <string>
  4. #include <limits>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. cout<<"The sizeof(char) is: "<<numeric_limits<char>::min();
  10. cout<<"\nThe sizeof(short) is: "<<sizeof(short);
  11. cout<<"\nThe sizeof(int) is: "<<numeric_limits<char>::min();
  12. cout<<"\nThe sizeof(long) is: "<<sizeof(long);
  13. cout<<"\nThe sizeof(long long) is: "<<sizeof(long long);
  14. cout<<"\nThe sizeof(float) is: "<<sizeof(float);
  15. cout<<"\nThe sizeof(double) is: "<<sizeof(double);
  16. cout<<"\nThe sizeof(long double) is: "<<sizeof(long double);
  17. cout<<"\nThe sizeof(bool) is: "<<sizeof(bool);
  18. }
  19.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
The sizeof(char) is: �
The sizeof(short) is: 2
The sizeof(int) is: �
The sizeof(long) is: 8
The sizeof(long long) is: 8
The sizeof(float) is: 4
The sizeof(double) is: 8
The sizeof(long double) is: 16
The sizeof(bool) is: 1