Beginner C/C++

Moderators: None (Apply to moderate this forum)
Number of threads: 5430
Number of posts: 16951

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Puzzling Question Posted by shuvam on 24 Jan 2006 at 10:29 AM
I faced a very puzzling question.

"Is there a program which runs in C but not in C++?"
Report
Re: Puzzling Question Posted by tom_sw on 24 Jan 2006 at 3:56 PM
: 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++.
Report
Re: Puzzling Question Posted by (cc) on 25 Jan 2006 at 12:08 AM
: : 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
Report
Re: Puzzling Question Posted by IDK on 25 Jan 2006 at 2:31 AM
: : : 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...
Report
Re: Puzzling Question Posted by shuvam on 25 Jan 2006 at 4:04 AM
: : : : 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.
Report
Re: Puzzling Question Posted by IDK on 25 Jan 2006 at 4:36 AM
: : : : : 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
Niklas Ulvinge aka IDK

Report
Re: Puzzling Question Posted by shuvam on 25 Jan 2006 at 11:43 PM
: : : : : : 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
: Niklas Ulvinge aka IDK
:
:
Thanks. It was a really really great suggestion.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.