SDL_GetRGB function problems please help!

Hi I can send the scourse if you want but since some people find that
rude email me back if you want it I will try to describe it here

ok I get a file stderr.txt that says

Fatal signal: Segmentation Fault (SDL Parachute Deployed)

and doent creat the stdout file that shows my rgb values from printf
so I think it exits when it gets to SDL_GetRGB becouse it works fine
if I comment the line out.

here is the way I wrote the function

SDL_GetRGB(pixel,fmt,&r,&g,&b);

Here are the definitions that I put into the function A unsigned char
seemed like the only varieable that was 8 bits long is it supposed to
be something else?

unsigned long pixel=0;

pixel = getpixel(screen,x,y);

unsigned char r,g,b;

and fmt from

SDL_PixelFormat *fmt; now am I supposed to fill that somehow?__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

SDL_PixelFormat *fmt; now am I supposed to fill that somehow?

     You're not supposed to, as the surface you're trying to read the 

pixel already has it. Use pixel->format instead of trying to create a new
format from scratch (anyway, you would need to use the image format to know
the correct bpp and stuff). Also, check the documentation on SDL_Surface to
see what else you can get from it :).

     Paulo