C++ Tutorial/Language Basics/extern

Материал из C\C++ эксперт
Перейти к: навигация, поиск

Link as a C function

#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.