如何在C#中重新声明那个C++模板函数?
谢谢! 另一个保守的问题 - 如何将字节附加到该数组(memcpy())中,我应该使用指针吗?
template <class type>
void ReadArray(type * array, unsigned short count)
{
int s = sizeof(type) * count;
if(index + s > size)
throw(std::exception("Error 102"));
memcpy(array, stream + index, s);
index += s;
}
当被调用时,它会通过在特定位置(索引)读取流(stream)并向给定数组中追加字节/单词/(类型)。
我尝试将声明重做如下,但出现错误:
public static T void ReadArray(<T> Array inputarray) // error
{
...
}
谢谢! 另一个保守的问题 - 如何将字节附加到该数组(memcpy())中,我应该使用指针吗?