I'm programming a CD Player application. The program asks the user
which track to play and so on. But if the player is already playing a
track, and the user types 'P', and decides that he wants to continue
playing the song anyway - and he presses Enter at the "Which track"
prompt, the same song will be reloaded (Which it shouldn't.)

Here's a piece of code from the player:

--
        mvprintw(4, 9, "Which track do you want to play?");
        echo();
          mvscanw(4, 42, "%d", &track);
--

This mvscanw() function (same as scanf()) should simply ignore users
who press enter instead of loading the same song again. So the user may
continue listening to his song.

Maybe I've been a bit unclear; what I'm looking for is a way that
scanf() can ignore an Enter-stroke when it expects an integer.


Thanks in advance..
T. Kristoffersen <[EMAIL PROTECTED]>


Reply via email to