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
How can you link a c++ program to c functions?
What are the 2 main types of data structures?
What is the header file for setw?
Write a function that swaps the values of two integers, using int* as the argument type?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
what is a reference variable in C++?
Can you use the function fprintf() to display the output on the screen?
Where are setjmp and longjmp used in c++?
What is a vector c++?
What is a Default constructor?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened
How new/delete differs from malloc()/free?
What are all predefined data types in c++?
What are c++ variables?