In C++ I want to declare an array of pointers that are either unsigned char or unsigned short, depending on some input. So it would like either
unsigned char *data = new unsigned char[N];
or
unsigned short *data = new unsigned short[N];
What's the best way to go about this?
unsigned char*, and then go about reading values from that array based on the input (cast toshortlater if necessary)