Tuesday, 9 October 2012

keep in mind while compiling the c programme in an c++ compiler


In general, you can use a C++ compiler to compile a C program. In fact, today most compilers
handle both C and C++ programs. Thus, most programmers will use a C++ compiler to compile
their C code! However, since C++ was built upon the 1989 C standard, you must restrict your C
code to the features defined by that standard .(yor are not permited to use the features of c99)



There is one thing that you must be careful about when using a C++ compiler to compile a C
program: the file extension. By convention, C programs use the .C extension. C++ programs
use .CPP. Don't accidentally give your C program a .CPP extension. Differences between the two
languages might prevent a valid C program from being compiled
as if it were a C++ program. By
specifying the .C extension, you are telling the C++ compiler to perform a ''C compile.

No comments:

Post a Comment