View Single Post
Re: need a 2nd pair of eyes for c++ inheritance problem
Old
  (#9)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: need a 2nd pair of eyes for c++ inheritance problem - 30-03-2004

Quote:
Originally Posted by Tactifool
Sorry for takin so long to repost. [font=verdana, arial, helvetica][size=2]The problem is that you cannot convert a type that is a pointers to pointers to another pointer to pointer type (CharCount ** cannot be converted to a Sortable**).
I think in C++ you can convert anything to anything. Or you can use void* and convert it to anything.

I once did this.

PHP Code:
void    *test_in;
...
// dynamic array creation
test_in=(void *)new float*[numofsamples];
for(
DWORD i=0;i<numofsamples;i++)
    *((
float **)test_in+i)=new float[in_size];
...
// dynamic array destruction
if(test_in!=NULL) {
    for(
int i=0;i<test_count;i++)
        if(((
float **)test_in+i)!=NULL)    
            
delete *((float **)test_in+i);
    
delete test_in;



kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)
  
Reply With Quote