Original Post
Hi. I'm trying to typecast a member of an integer array to a void pointer for universal storage (my plan later being to convert the datatype to an image). Here's my code: This code has no compile errors, however at runtime I get the following error: Unhandled exception at 0x005b0fdc in 1.exe: 0xC0000005: Access violation reading location 0x00000005. And C++ brings up line 438 in iosfwd (which probably doesn't mean much to anyone here). What exactly am I doing wrong? How can I return a void pointer to an array member? Thank you.
void* register()
{
int x;
int *pTextures;
int pCounter = 0;
pTextures = new int[1];
pTextures[0] = 5;
return (void*)pTextures[0];
}