Answer Posted / ravindranath m
The C++ compiler does something called as "name mangling"
for functions, while a C compiler does not. Name mangling
is a process wherein the name of the original function in a
c++ program gets changed to a new name via adding some
prefix and/or postfix to it.
As a result, a c program cannot find the required definition
when trying to link to a cpp object file.
This can be resolved by putting the following declaration in
a c++ header file that contains the cpp function declarations.
#ifdef __cplusplus
extern "C" {
#endif
// function declarations go here...
// ...
#ifdef __cplusplus
}
#endif
| Is This Answer Correct ? | 25 Yes | 4 No |
Post New Answer View All Answers
give me an example for testing a program showing the test path .show how the test is important and complex.
Define the process of error-handling in case of constructor failure?
Why the usage of pointers in C++ is not recommended ?
What is c++ runtime?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
How c functions prevents rework and therefore saves the programers time as wel as length of the code ?
Write some differences between an external iterator and an internal iterator?
What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00
Is c better than c++?
How many types of comments are there in c++?
What does floor mean in c++?
What parameter does the constructor to an ofstream object take?
What are arithmetic operators?
What c++ is used for?
What is different in C++, compare with unix?