I am asking this because I'm writing a C++ program which uses a C library. This library has foreach
functions that take a callback (naturally). Obviously, the library would call my callbacks as C functions.
First of all, does this have anything to do with linkage of C vs C++?
If it does, is something like this valid and correct?
extern "C" static bool callback(/*parameters*/)
{
cout << "C++ thing inside the function" << endl;
/* etc */
}
No comments:
Post a Comment