You could try an explicit cast: prgpstrShow = (char **) alloc_mem(count * sizeof (char *)); prgnShow = (int *) alloc_mem(count * sizeof(int));
> -----Original Message----- > From: Jason Snuggs [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 27, 2001 10:06 AM > To: [email protected] > Subject: Converting Rom to c++ question on alloc_mem > > > Howdy, > I was trying to convert Rom from c to c++ and ran into one > problem that I'm not knowledgable enough with c++ to fix. > Which isn't shocking, I'm fairly new to c++, but that's > another story. Anyway, I've been using Michael k Weise' > memory management for some time in c, it makes alloc_mem > return a void like this: > > void *alloc_mem( size_t sMem) > > Then in some procedures such as who it uses that to allocate > memory to a char or int array like. > char **prgpstrShow; > int *prgShow; > prgpstrShow = alloc_mem(count * sizeof (char *)); > prgnShow = alloc_mem(count * sizeof(int)); > > Anyway, this is basically still just stock, but what I get > when trying to compile is: cannot convert `void *' to `char > **' in assignment or cannot convert `void *' to int *' in > assignment. C didn't have problems converting this, but c++ > does. I'm sure this is something I should be able to fix > fairly easily, I'm just not sure how. > > Thanks, > Jason > > _____________________________________________________________ > wotmania: Your number one source for The Wheel of Time. > http://wotmania.com > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom >

