且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

制作结合c和c#代码的软件

更新时间:2023-02-07 20:11:26

不可能. C不是OO,C#强制OO作为开始.如果您说的是C ++和C#,则可以使C ++代码成为C ++/CLI,并将一组代码放入dll.否则,您可以构建一个C dll,然后使用p/invoke对其进行调用.但是您不能拥有一个使用C和C#甚至C ++和C#的项目.
Not possible. C is not OO, and C# forces OO, for a start. If you said C++ and C#, then you could make your C++ code C++/CLI and put one set of code in a dll. Otherwise, you could build a C dll, and call it using p/invoke. But you can''t have one project with C and C#, or even C++ and C#.