Mail Archives: djgpp/1997/11/20/18:32:38
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
: Seems like _puts would be a better choice. `printf' pulls in a lot of
: support code from libc which aren't needed to print a fixed string.
: (`printf' can also get you in trouble if the string includes `%'
: characters.)
Hi, there.
As a newbie GAS programmer, I agree. Generally I use '_puts' for simple
text messages, saving '_printf' for things where I don't want a newline
after the string, or where I need formatted output (for example. to
display a numerical result).
Most appreciatively,
Margo Schulter
mschulter AT value DOT net
>
int main(void]
{
MIDI *the_midi = load_midi("mission.mid");
if (!the_midi)
{
printf("Midi file did not load. Check if it exists.\n");
return 1;
}
allegro_init();
install_sound(DIGI_NONE, MIDI_AUTODETECT, NULL);
install_timer();
install_keyboard(); // for the heck of it
play_midi(the_midi, 1);
read_key(); // pauses utill you hit a key
stop_midi();
destroy_midi(the_midi);
allegro_exit();
return 0;
}
Your program 1) loads the midi twice, once unncessairly, and
- Raw text -