Thread: Question...........?

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    7

    Question...........?

    Can anyone give me program work in turbo C++ compiler and Dec-C++ but give different result?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    7
    Is there another one?

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    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';
    }

  5. #5
    Registered User
    Join Date
    Jan 2007
    Posts
    7
    I need ready program do that.

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    201
    Quote Originally Posted by alalam5
    I need ready program do that.
    why? homework?

  7. #7
    Registered User
    Join Date
    Jan 2007
    Posts
    7
    No, challenge question...........!!!!

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM