测试cdecl调用约定,但它是关于这一点困惑: 原来的C代码: int __attribute__((cdecl)) add(int a,int b)
{
int i;
i = a+b;
return i;
}
void __attribute__((cdecl)) print(int i, ...)
{
int j,a,b;
为什么Foo()成功,但Bar()会抛出BadImageFormatException? using System.Runtime.InteropServices;
using System.Text;
static class Program
{
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cde