Puzzling Question - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Puzzling Question

shuvamshuvam Posts: 9Member
I faced a very puzzling question.

"Is there a program which runs in C but not in C++?"

Comments

  • tom_swtom_sw Posts: 828Member
    : I faced a very puzzling question.
    :
    : "Is there a program which runs in C but not in C++?"
    :
    I was taught that C++ is a superset of C, so any program written in C should also run (or at least be compilable) in a C++.
  • (cc)(cc) Posts: 23Member
    : : I faced a very puzzling question.
    : :
    : : "Is there a program which runs in C but not in C++?"
    : :
    : I was taught that C++ is a superset of C, so any program written in C should also run (or at least be compilable) in a C++.
    :
    wonder when or if they will save us all and make it one language
  • IDKIDK Posts: 1,784Member
    : : : I faced a very puzzling question.
    : : :
    : : : "Is there a program which runs in C but not in C++?"
    : : :
    : : I was taught that C++ is a superset of C, so any program written in C should also run (or at least be compilable) in a C++.
    : :
    : wonder when or if they will save us all and make it one language
    :
    You could say that C++ is both so, then it is one language...
  • shuvamshuvam Posts: 9Member
    : : : : I faced a very puzzling question.
    : : : :
    : : : : "Is there a program which runs in C but not in C++?"
    : : : :
    : : : I was taught that C++ is a superset of C, so any program written in C should also run (or at least be compilable) in a C++.
    : : :
    : : wonder when or if they will save us all and make it one language
    : :
    : You could say that C++ is both so, then it is one language...
    :
    This question was given by an interviewer from a software co. My friend who faced for simply freaked out by the quyestions he made.
  • IDKIDK Posts: 1,784Member
    : : : : : I faced a very puzzling question.
    : : : : :
    : : : : : "Is there a program which runs in C but not in C++?"
    : : : : :
    : : : : I was taught that C++ is a superset of C, so any program written in C should also run (or at least be compilable) in a C++.
    : : : :
    : : : wonder when or if they will save us all and make it one language
    : : :
    : : You could say that C++ is both so, then it is one language...
    : :
    : This question was given by an interviewer from a software co. My friend who faced for simply freaked out by the quyestions he made.
    :
    I got it!

    Look at this definition I got from my book: (translated from swedish)
    In ANSI-C can a global name be declared multible times, it can only be declared one time in C++

    In ANSI-C you can use void * on the right side of an asignment.

    In ANSI-C is it possible to skip a initiation, it isn't allowed in C++.

    There's some more but this should be enought.

    Happy coding wishes
    the one and only
    [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]

  • shuvamshuvam Posts: 9Member
    : : : : : : I faced a very puzzling question.
    : : : : : :
    : : : : : : "Is there a program which runs in C but not in C++?"
    : : : : : :
    : : : : : I was taught that C++ is a superset of C, so any program written in C should also run (or at least be compilable) in a C++.
    : : : : :
    : : : : wonder when or if they will save us all and make it one language
    : : : :
    : : : You could say that C++ is both so, then it is one language...
    : : :
    : : This question was given by an interviewer from a software co. My friend who faced for simply freaked out by the quyestions he made.
    : :
    : I got it!
    :
    : Look at this definition I got from my book: (translated from swedish)
    : In ANSI-C can a global name be declared multible times, it can only be declared one time in C++
    :
    : In ANSI-C you can use void * on the right side of an asignment.
    :
    : In ANSI-C is it possible to skip a initiation, it isn't allowed in C++.
    :
    : There's some more but this should be enought.
    :
    : Happy coding wishes
    : the one and only
    : [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
    :
    :
    Thanks. It was a really really great suggestion.
Sign In or Register to comment.