How to repeat the declaration of this function of a C ++ template 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 adds bytes / word / (type) to the given array, reading the stream (stream) at a specific position (index).
I tried to repeat an ad like this, but I get an error
public static T void ReadArray(<T> Array inputarray)
{
...
}
Thanks!
Another conservative question: how to add bytes to this array (memcpy ()), should I use a pointer?
source
share