Righty, I am trying to load a bitmap and I want to allocate it some memory for the actual bitmap bits.
GLubyte *bits;
bits = malloc(bitsize);
if (bits == NULL)
{
// Couldn't allocate memory - return NULL
free(*info);
fclose(fp);
return (NULL);
}
The error I'm getting in (VC++ 6.0) is:
"error C2440: '=' : cannot convert from 'void *' to 'unsigned char *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast"
Now the declaration of malloc is
void malloc(...) but in the example in the help file it shows malloc being used for allocating memory to a pointer to a character i.e:
char *string;
/* Allocate space for a path name */
string = malloc( _MAX_PATH );
if( string == NULL )
printf( "Insufficient memory available\n" );
Any ideas - they will be much appreciated!
Max
Edited by - sckoobs on March 17, 2001 8:43:12 AM