5
SizeOf
- #include <iostream>
- int main() {
- using namespace std;
- cout << "Size in bytes:" << endl;
- cout << "\t char: " << sizeof (char) << endl;
- cout << "\t short: " << sizeof (short) << endl;
- cout << "\t int: " << sizeof (int) << endl;
- cout << "\t long: " << sizeof (long) << endl;
- cout << "\t float: " << sizeof (float) << endl;
- cout << "\t double: " << sizeof (double) << endl;
- cout << "\t long double: " << sizeof (long double) << endl;
- cout << "\t void *: " << sizeof (void *) << endl;
- }
Comments