replacing output in console without clearing

I am making a blackjack game for practice and so far it looks like this
---------------------------------
two of clubs
queen of spades


hit or stay (h/s)...
---------------------------------
now if I choose hit, i need to add another card underneath the queen of spades, but if I clear the screen and reprint it with the next card the random function prints new cards for the first two messing everything up. is there a way to keep the first two lines then add another random card with the option to hit or stay three lines under the new card? like this?
---------------------------------
two of clubs
queen of spades
3 of diamonds


hit or stay (h/s)...
---------------------------------
Last edited on
Instead of using iostream I think you'll need to use something like ncurses or curses. That will let you move a cursor to replace specific characters.
Topic archived. No new replies allowed.