Here is the code:
#include <iostream>
using namespace std;
extern "C" void myCfunc();
int main()
{
myCfunc();
return 0;
}
// This will link as a C function.
void myCfunc()
{
cout << "This links as a C function.\n";
}
It prints:
This links as a C function.
Why is the extern keyword used? What meaning does it have?
While we are at it, what is the mutable keyword?
mutable int i;
What is different between it and int i?