Original Post
Take
// Client[socket].UserNum is a int.
// declare a char pointer and reserve 4 bytes of RAM
char *num = (char *)malloc(sizeof(int));
// convert the int into chars
num = (char *)&(Client[socket].UserNum);
// free the 4 bytes of RAM
free(num);
There is actually more to it than this but ive narrowed the problem down to here. Its the free command that generaes and Assertion error with Abort/Ignore/Retry. It says dbgheap.c generated an error in line 1011 when it was checking to see if it was a valid heap pointer.
Now I just don''t understand how in the world that a little data can screw up the pointer... My only theory is that what im doing is highly illegal... However all the code associated with this worked fine untill i added the free. I mean the num came out with the right data I''m pretty sure.... If I can''t assign it to num this way how can I do it?