Determining Storage Size using operator sizeof() for the int, char, and bool data types. - C++ Data Type

C++ examples for Data Type:Introduction

Description

Determining Storage Size using operator sizeof() for the int, char, and bool data types.

Demo Code

#include <iostream>
using namespace std;
int main()/*from   ww w. ja v a 2 s.  c o m*/
{
   cout << "\nData Type   Bytes"
   << "\n---------   -----"
   << "\nint          " << sizeof(int)
   << "\nchar         " << sizeof(char)
   << "\nbool         " << sizeof(bool)
   << '\n';
   return 0;
}

Result


Related Tutorials