c# 这样写
[C#] 纯文本查看 复制代码 using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
public struct inx
{
public int i;
public double rr;
}
public struct outx
{
public int a;
public double rr;
}
[DllImport("fortran_lib")] extern static int myfortran(ref inx A, ref outx B);
static void Main(string[] args)
{
inx X;
outx Y;
X.i = 3;
X.rr= 6.0;
Y.a = 1;
Y.rr=3.0;
int c = myfortran( ref X , ref Y );
Console.WriteLine("c# return:");
Console.WriteLine(Y.rr);
Console.Read();
}
}
} |