-1
我在C++这些声明:转换C#和C++与元帅问题
struct objectStruct;
int positionMemory = getPosition();
short size = getSize();
void *allocatedObject; // Originally, it is in C#: IntPtr allocatedObject { get; private set; }
byte[] byteName = Encoding.ASCII.GetBytes("Hello There");
我想从C#这行代码转换为C++:
string result = Marshal.PtrToStringAnsi(new IntPtr(positionMemory), size);
Marshal.StructureToPtr(objectStruct, new IntPtr(positionMemory), true);
Marshal.Copy(byteName, 0, new IntPtr(positionMemory), size);
long posInMemory = allocatedObject.Offset(size).ToInt64();
我不熟悉的封送处理。
什么问题?你想做什么? C++声明与C#代码有什么关系(从您展示的内容中不完全清楚)? – Kiril
我需要将一些C#代码转换为C++,并面临如何从C#转换为C++编译上述对象的问题 – olidev