On Thu, Sep 12, 2002 at 05:24:55PM +0530, Anoop Johnson wrote:
>     Binand> ie, please demonstrate how you'd compile a C++ program with a
>     Binand> purely C compiler.
> 
> [anoop@lonewolf:anoop]$ cat a.C 
> #include <iostream>
> 
> int main (void) {
>     cout << "Hello World" << endl;
>     return 0;
> }
> 
> [anoop@lonewolf:anoop]$ gcc -x c++ a.C -o /dev/null -lstdc++
> [anoop@lonewolf:anoop]$ 

Purely C? -x c++ essentially tells gcc (as in the compiler suite) to not to
go by the file extension; but use the language specified. So you are compiling
a C++ program using the C++ compiler in the compiler suite.

Compile with gcc -x c and tell me.

Binand

-- 
If you found this helpful, please take some time off to rate it:
http://svcs.affero.net/rm.php?r=binand


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to