It's a good example of why brackets should be used even if you think you know what you are doing. This code works as expected:
cout << ((sizeof(char *) == 8) ? "64-bit" : "32-bit");
and displays "64-bit" if the program is built for a 64-bit CPU and "32-bit" if 32-bit.

Without the braces it displays 1 for 64-bit and 0 for 32-bit and is equivalent to:
(cout << (sizeof(char *) == 8)) ? "64-bit" : "32-bit";