You could disassemble the executable. But what for? To find out whether you have 4 more bytes in the static section?
Here's something you can try with only generating assembly:
Code:
#include <iostream>
const int CON = 100;
int main()
{
std::cout << CON << '\n';
}
Enable optimizations and find CON in the assembly output. (I tried this with GCC 3.4.4 and -O2)
As long as you treat constants as constants and not as variables (e.g. take the address), they won't even be emitted. Size requirement: zero. Whereas if they're extern, they always need the space.