>>--host=i386-redhat-linux
Well I'm not running Redhat. It seems that Debian's gcc are configured for a variety of languages.
"--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang"
No wonder your c code wouldn't compile.
All the pointers seems to get me somewhat confused. But I managed to write a compare() function that's working in my c++ environment.
>>also c style casts ( that is "(type)expression") should be avoided in >>c++.Code:int compare ( const void *a, const void *b ) { const info **pa = (const info **)a; const info **pb = (const info **)b; return strcmp( (*pa)->name, (*pb)->name ); }
>>there is static_cast and dynamic_cast.
As you can see the above code uses c style typecast. I haven't gotten to c++ typecasting yet. But I read some on the net but I can't get the c++ typecasting to work on the code above. Perhaps you could show a newbie how it should be done?



LinkBack URL
About LinkBacks


