943,930 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4492
  • C++ RSS
Dec 10th, 2005
0

Some thingthat we can do in C and Not in C++

Expand Post »
If any body knows it, Pls. post me reply to this
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Naveena is offline Offline
2 posts
since Dec 2005
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

C++ can to everything that C can do plus a lot more. There is nothing in C that can't be done by c++.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

Aha... implicit function declarations ! Rather weak thought, but it feels the same as saying something that can not be done in c but in c++, both are complete turing machines and can as such do everything a turing machine can (I heard somewhere that the template language in c++ are also turing complete, interesting side note).
C++ Syntax (Toggle Plain Text)
  1. int main(...)
  2. {
  3. function( 10 );
  4. }
  5.  
  6. ...
  7.  
  8. int function( 10 )
  9. {
  10. }
Reputation Points: 29
Solved Threads: 4
Junior Poster in Training
perniciosus is offline Offline
78 posts
since Nov 2005
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

>Some thingthat we can do in C and Not in C++
Compile on certain embedded systems.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

Quote originally posted by Narue ...
>Some thingthat we can do in C and Not in C++
Compile on certain embedded systems.
Yea, but those embdded systems are not ansi C compliant either. There is a different C standard for embedded systems, such is a subset of standard C and embedded systems don't have to use that standard either. Many embedded systems don't support C at all.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

C99:
C++ Syntax (Toggle Plain Text)
  1. int main(void) {
  2. _Bool b;
  3. return 0;
  4. }
C89:
C++ Syntax (Toggle Plain Text)
  1. int main(void) {
  2. double x = 1 //**/ 10;
  3. return 0;
  4. }
For the second program, C++/C99 sees the double line as
double x = 1 //**/ 10;
whereas C89 sees it as
double x = 1 //**/ 10;
Reputation Points: 185
Solved Threads: 28
Posting Whiz in Training
dwks is offline Offline
269 posts
since Nov 2005
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

Quote originally posted by dwks ...
C99:
C++ Syntax (Toggle Plain Text)
  1. int main(void) {
  2. _Bool b;
  3. return 0;
  4. }
what is _Bool ? never seen that data type. should it be bool ?
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Dec 10th, 2005
0

Re: Some thingthat we can do in C and Not in C++

bool is typedefed as _Bool (which is the actual data type) in <stdbool.h>.
Reputation Points: 185
Solved Threads: 28
Posting Whiz in Training
dwks is offline Offline
269 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: spaces in binary file not showing
Next Thread in C++ Forum Timeline: 2 structs





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC