
Untitled
By: a guest on
May 11th, 2012 | syntax:
C++ | size: 0.63 KB | hits: 33 | expires: Never
#define PLATFORM_IOS (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
#define PLATFORM_OSX (defined(__APPLE__) && !PLATFORM_IS_IOS)
#define PLATFORM_WINDOWS defined(_WIN32)
#include <iostream>
/*
* This code outputs "What am I doing wrong?!?!?" and then "Cows!"
* I think it should output "Hoorah!" and then "Cows!"
* Why doesn't it?
*/
int main()
{
#if PLATFORM_WINDOWS
std::cout << "Hoorah!" << std::endl;
#else
std::cout << "What am I doing wrong?!?!?" << std::endl;
#endif
#if defined(_WIN32)
std::cout << "Cows!" << std::endl;
#else
std::cout << "Organs!" << std::endl;
#endif
system("pause");
}