Hopefully I can be of some help, again. There is a way to accomplish what you want, and it's actually not all that complex. But you have to be extremely careful in what you do, or else memory leaks and other problems will start popping up like the devil.

Code:

int main()
{
int *iData;
int i;

iData = (int *) malloc(sizeof(int) * 2);

iData[0] = 100;
iData[1] = 200;

i = iData[0];

if (i == 100)
MessageBox(NULL, "Success; i == 100", "Huzzah", MB_OK);

i = iData[1];
if (i == 200)
MessageBox(NULL, "Success; i == 200", "Huzzah", MB_OK);

return 0;
}



So, effectively, all you need to do (in this example) to expand your array is to iData = (int *)malloc(sizeof(iData) + sizeof(int)). This is a usable solution, but realize there are risks involved. If you don't have solid memory management, you run the risk of severe memory leakage causing strange problems in unrelated systems.

Hope this helps,
FixxeR


John Dies at the End - One of the best fictional stories online. Join the fight for Internet Freedom