I want to pass in an array of parameters to SQLBindParameters, and have this array held in a char array(since I don't know the type beforehand) (I want all the elements in the 'array' to be the same).
I'll have a pointer to a sample parameter type, and the size of the parameter.
void *buffer = getBuffer();
int bufferLength = getBufferLength();
const int numElements = 200; //for example
char *array = new char[bufferLength * numElements];
for(int i=0; i < numElements; ++i)
{
memcpy(array + (i * bufferLength), buffer, bufferLength)
}
// now use array in SQLBindParameter call
will this work as expected, without any alignment issues? (i.e., the same as if I had just declared an array of the right type to start with)