Link as a C function : extern « Language Basics « C++ Tutorial






#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";
}
This links as a C function.








1.15.extern
1.15.1.Link as a C function