how read colors in .3ds files ?

I don’t manage to read colors’meshes in my .3ds files. I read in the 0xa010 then in 0x0011 but when i display the red, green and blue values by doing a cast to an integer i have for example a white color instead of a brown one (for the color of skin of a character)under 3d studio max.
Can you help me ?

 case 0x0011: unsigned char red, green, blue ;*)&red, sizeof (unsigned char));*)&green, sizeof (unsigned char));*)&blue, sizeof (unsigned char));
						 cout<<dec<<"rouge "<<(int)red<<" vert "<<(int)green<<" bleu "
							 <<(int)blue<<endl ;
						 break ; 

It seems like use correct way to load color values from 3ds file. I’ve load colors using 0x0011 chunks in very similar way and can’t say that result is incorrect. By the way, what the output operator show in your case? All 255? Maybe you have an error of convertion those values later to floating points without division by 255?

Hi !
Without dividing by 255 i always have white color, by dividing by 255 i have black color, both by using this code before glDrawElement :

float red= 223/255 ;
float green= 174/255 ;
float blue= 132/255 ;
glColor3f(red, green, blue);  

Hmm, there’s a mistake I myself run into sometimes. When doing the division remember to put 255.0 so as to convert the number to double (or 255.0f for float). Without it the program executes integer division which would give 0 or 1. Is there a chance you could post the code for the .3d loader here? I’d like to take a look at it.

Thanks for your help guys !
what part of the .3ds loader do you want to see ? it is a very long program.

As moucard tell you use 255.0f instead of simply 255 when you divide.