I'm trying to send an integer array of size 480X640 to another machine over UDP using winsock programming in C++. I can typecast the array to char * before sending, but i can't figure out how to cast the char * back to integer array. The code segment looks like this:
int arrayData[480][640];
char * arrayChar;
arrayChar = (char *)&arrayData;
// send it to the other end over UDP
// at the other end, receive and convert char * to integer array
Is this typecast valid? If anyone could help me with converting 'arrayChar' back to integer array, it would be great.