Can anyone give me program work in turbo C++ compiler and Dec-C++ but give different result?
Can anyone give me program work in turbo C++ compiler and Dec-C++ but give different result?
Like printing the value of sizeof(int) perhaps?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Is there another one?
Detect compiler specific macros and you can do anything you like. For example;
Code:// untested code // Yes, this is C++ code. Same idea, with different specifics works in C #include <iostream> int main() { std::cout << #if defined (__DECCXX) "Dec" #elif defined (__TURBOC__) "Turbo" #else "Something else" #endif << '\n'; }
I need ready program do that.
why? homework?Originally Posted by alalam5
No, challenge question...........!!!!
How about saying what your real question is?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.