Tuesday, July 28, 2009

Which c program compiles in c compiler but not in c++ compiler?

Depends on the format it is written in.


Basically Any program written in c can be compiled with C++ compiler but not vice versa.

Which c program compiles in c compiler but not in c++ compiler?
Because C and C++ are different languages.





A lot of expressions, which create warnings in C, create errors in C++.





An example:


unsigned char *p="hello world";





"hello world" is actually a signed char *, not unsigned char *. This triggers a warning in most C compilers, but errors in C++ compilers.





Same with assigning const pointers to non-const pointers.





etc etc.
Reply:Use header file like %26lt;stdio.h%26gt; instead of %26lt;cstdio%26gt;, in new compilers. May be try a goto statement that should make your compiler a little hot under the collar. Sorry but thats all i can think of.
Reply:Look dear to writing is not possible here but .....now a days version 3 single compiler use for both c and c++ i.e. only required the header file to compile it .....





for more help ask to expert for it just go through the url given below .........and contact with concern id of it ...


http://www.commediait.com

sweet pea

No comments:

Post a Comment