Error: explicit type cast cannot convert 'void* to 'int*'
I'm a newbie, so please bear with:
Here's my problem and the line I get an error on:
int *buf = GlobalAlloc(GPTR, sizeof(int) * count);
when I compile the program that contains this line in C everything works fine. However when I rename my file to .cpp then I get the following error:
error C2440: 'initializing' : cannot convert from 'void *' to 'int *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
I am missing something in there I know. Something about bout c++ requires explicit casts.
What am I missing and why do I need it?
Any help would be great!
Quickest draw in the west
::Blows smoke from the barrel of revolver::
Originally posted by FillYourBrain
dang it fordy! you're fighting for that mod spot aren't you! just a half a second too late with my reply