C#에서 C++ Function 호출 • • C#에서 DLLImport 를 사용하여 C++의 dll을 로딩 C#코드 using System. Runtime. Interop. Services; // DLLImport를 사용하기 위한 namespace Console. Application { class Program { } • } [Dll. Import(“test. dll”)] public static extern int fntext 3(); // c++ function과 같은 type으로 선언한다. static void Main(string[] args] { Console. write(fntest 3()); } C++코드 extern “C” __declspec(dllexport) int fntest 3(void) { return 10; } ※ extern “C” 키워드가 없을 경우 함수 이름이 변형되므로 C#에서 사용이 불가능하다.