SmileeTiger
Programmer
I am trying to do something with a pointer to an array of characters being passed to a function. More or less what I want to do is place the contents of the array into another array that I have created with a pointer pointing to it.
void Func(unsigned char *data, int dataWidth)
{
int width=100;
unsigned char *NewData= new unsigned char[width];
for (int i=0; i<dataWidth; i++)
*(NewData+i)=(data+i);
}
Should this work?
Smilee
void Func(unsigned char *data, int dataWidth)
{
int width=100;
unsigned char *NewData= new unsigned char[width];
for (int i=0; i<dataWidth; i++)
*(NewData+i)=(data+i);
}
Should this work?
Smilee