Week's simplest program!
I was just wondering... what will be the size of the data types on this computer? (Must recognize I hadn't done any research before wondering, then I would have discovered that mac's follow IEEE754 standard, as windowss -or that they say-).
So there we go with it:
#include <stdlib>
using namespace std;
int main (int argc, char * const argv[]) {
// insert code here...
cout << "Type sizes" << endl;
cout << "BOOL " << sizeof(bool) << endl;
cout << "CHAR " << sizeof(char) << endl;
cout << "INT " << sizeof(int) << endl;
cout << "FLOAT " << sizeof(float) << endl;
cout << "DOUBLE " << sizeof(double) << endl;
cout << "INT* " << sizeof(int*) << endl;
return 0;
}
And what does it return?
Type sizes BOOL 4 CHAR 1 INT 4 FLOAT 4 DOUBLE 8 INT* 4```
Bool types use 4 bytes!?! WTF?!