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

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2005
Posts: 2
Reputation: Naveena is an unknown quantity at this point 
Solved Threads: 0
Naveena Naveena is offline Offline
Newbie Poster

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

 
0
  #1
Dec 10th, 2005
If any body knows it, Pls. post me reply to this
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,346
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1460
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #2
Dec 10th, 2005
C++ can to everything that C can do plus a lot more. There is nothing in C that can't be done by c++.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 78
Reputation: perniciosus is an unknown quantity at this point 
Solved Threads: 4
perniciosus's Avatar
perniciosus perniciosus is offline Offline
Junior Poster in Training

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

 
0
  #3
Dec 10th, 2005
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).
  1. int main(...)
  2. {
  3. function( 10 );
  4. }
  5.  
  6. ...
  7.  
  8. int function( 10 )
  9. {
  10. }
/pern.*/i

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. Albert Einstein
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,599
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 712
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

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

 
0
  #4
Dec 10th, 2005
>Some thingthat we can do in C and Not in C++
Compile on certain embedded systems.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,346
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1460
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #5
Dec 10th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 251
Reputation: dwks has a spectacular aura about dwks has a spectacular aura about 
Solved Threads: 25
dwks's Avatar
dwks dwks is offline Offline
Posting Whiz in Training

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

 
0
  #6
Dec 10th, 2005
C99:
  1. int main(void) {
  2. _Bool b;
  3. return 0;
  4. }
C89:
  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;
dwk

Seek and ye shall find.

"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.

"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison

"The only real mistake is the one from which we learn nothing."
-- John Powell
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,346
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1460
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #7
Dec 10th, 2005
Originally Posted by dwks
C99:
  1. int main(void) {
  2. _Bool b;
  3. return 0;
  4. }
what is _Bool ? never seen that data type. should it be bool ?
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 251
Reputation: dwks has a spectacular aura about dwks has a spectacular aura about 
Solved Threads: 25
dwks's Avatar
dwks dwks is offline Offline
Posting Whiz in Training

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

 
0
  #8
Dec 10th, 2005
bool is typedefed as _Bool (which is the actual data type) in <stdbool.h>.
dwk

Seek and ye shall find.

"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.

"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison

"The only real mistake is the one from which we learn nothing."
-- John Powell
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC