Hello,
How to redo the declaration of that C++ template function in C#?
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;
}
When called,it append bytes/word/(type) in the given array by reading a stream(stream) at a specific position(index).
I tried to redo the declaration like this,but i get an error
public static T void ReadArray(<T> Array inputarray) // error
{
...
}
Thanks!
Another conservative question - how to append the bytes into that array(memcpy()),should i use a pointer?