LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-23-2006, 09:16 AM   #1
aditya1
Member
 
Registered: Mar 2005
Location: College station, Texas
Distribution: UBUNTU 10.04
Posts: 61

Rep: Reputation: 15
in c but not in c++


can somebody suggest a code which will compile only on c compiler but not on c++ compiler
 
Old 03-23-2006, 09:29 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Code:
int main()
{
	int operator;
	operator= 0;
	return 0;
}
 
Old 03-23-2006, 09:30 AM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Homework?
Think about the standard header files how do they differ and how could that be used to answer your question?
 
Old 03-23-2006, 10:14 AM   #4
Flesym
Member
 
Registered: Aug 2005
Location: Germany
Distribution: Ubuntu, Debian
Posts: 189

Rep: Reputation: 31
If you are really interested you may want to have a look here:
http://david.tribble.com/text/cdiffs.htm
There you will find a lot of informations about the incompatibilities of C and C++

Last edited by Flesym; 03-23-2006 at 10:15 AM.
 
Old 03-23-2006, 10:19 AM   #5
aditya1
Member
 
Registered: Mar 2005
Location: College station, Texas
Distribution: UBUNTU 10.04
Posts: 61

Original Poster
Rep: Reputation: 15
wow! nice prog
thanks a lot;
now i realise there can be many such programs
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration