C++ Review


The chart below provides an overview of the compilation process:


NEVER CONFUSE COMPILATION OF YOUR C++ PROGRAM...

WITH EXECUTION OF YOUR C++ PROGRAM...



Variables


What's going on?

Consider the C++ source code bits.cpp.

I compiled this code with g++ on a PC. A run of the resulting executable produces:

01000000010010001111010111000011
3.14
3.14
1078523331
sizeof(float) 4
sizeof(int) 4

Then I compiled the exact same code with g++ on a Sparc. A run of the resulting executable produces:

11000011111101010100100001000000
3.14
3.14
1078523331
sizeof(float) 4
sizeof(int) 4


Q: What variable types do you remember?