[Solved] why get I segmentation fault (core dumped) on compiling my code C (linux) [closed]


you declared the function:

int blit_image(char chemin[15],SDL_Surface *fenetre,int posx,int posy) {

So that that parameter #1 has 15 characters.

But when you call it, you call it with:

 blit_image("resources/images/fondblanc.bmp",fenetre,0,0); 

That filename is 31-characters by my counting, and will not fit into 15 characters.

I also added some printf-statements to your code which will help you figure out where it crashes.
You should continue to add more printf-statements until you narrow down the crash.

4

solved why get I segmentation fault (core dumped) on compiling my code C (linux) [closed]