Just a quick question about the following piece of code...
Code:
fprintf(stderr, "Couldn't load %s: %s\n", file_name,
... what does the %s sign mean/do? Is this a way to include characters otherwise would of ended the line of characters? I have did some search into this, didn't come with much of anything other then questions regarding it (in other ways then the way this is question is asking). I tried to run the code by itself with the following...
Code:
fprintf(stderr, "Couldn't load %s: %s\n");
I got this output...
Code:
george@georgescomp1:~/cfiles$ g++ RandomPercentageSign.cpp -o RandomPercentageSign
george@georgescomp1:~/cfiles$ ./RandomPercentageSign
Couldn't load X,\uffff\uffff\uffff\uffff\u05b7: \uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffff\uffffE\uffff)\uffff1\uffff\uffff\uffff9\uffffs\uffff\u05cdv
george@georgescomp1:~/cfiles$
I know the full code outputs that it could not find a certain file and says so... here is that code I retrived the above from:
Code:
/* Load the BMP file into a surface */
image = SDL_LoadBMP(file_name);
if (image == NULL) {
fprintf(stderr, "Couldn't load %s: %s\n", file_name,
SDL_GetError());
return;
}
... here is the output if I have a program of mine not have the needed bmp in the directory the program is running in...
Code:
george@georgescomp1:~/cfiles/George Lair/030506/032906/041506$ ./test031206
Couldn't load background.bmp: Couldn't open background.bmp
Couldn't load background.bmp: Couldn't open background.bmp
Couldn't load background.bmp: Couldn't open background.bmp
... NOTE: It just went on for 15 or so lines until I escaped
Couldn't load background.bmp: Couldn't open background.bmp
Couldn't load background.bmp: Couldn't open background.bmp
Couldn't load background.bmp: Couldn't open background.bmp
george@georgescomp1:~/cfiles/George Lair/030506/032906/041506$
... so exactly what does the %s do? I am assuming it copies/paste a certain piece of text, but that is just a guess from what I see above. Thanx in advance...