Right way to clear console screen

Sep 17, 2014 at 2:52am
Hey I wonder how to clear a console screen for a frame update in tic tac toe or some kind of games ?
I know that system("cls"); /*or*/ system("clear"); is not good
and clrscr();doesn't work for me
then for(int i=0;i<10;i++)std::cout<<"\n\n\n\n\n\n" doesn't work as i expected
i heard somthing abour curse library but I don't know how to use it :( any other method to do this ? Or just tell me how to use this curse to clear screen,

Thanks :D
Sep 17, 2014 at 2:56am
Sep 17, 2014 at 3:02am
it doesn't interact well with the standard streams. In other words, you shouldn't mixprintf() and the like or cout and the like with Curses
aww..
LB what's your suggestion ? Should I stick with system()
Sep 17, 2014 at 3:06am
Sep 17, 2014 at 3:07am
Is there any other way to do this :( ?
Sep 17, 2014 at 3:08am
The first link he posted shows you like 3 or 4 different ways.

Though my answer to this question would be: "don't". Console programs typically should not clear the console as it wipes history and that is annoying for people who actually use the console.
Last edited on Sep 17, 2014 at 3:10am
Sep 17, 2014 at 3:10am
In my first post too
Sep 17, 2014 at 3:14am
Sep 17, 2014 at 3:22am
I know that console is bad for game and I have some game engine installed its much easier to use, but this just a challenge from a friend, to create a simple game with c++ in console window
Sep 17, 2014 at 3:24am
You should point your friend to that article ;)
Sep 17, 2014 at 3:28am
Ahaha great suggestion :D but still T.T
Sep 17, 2014 at 3:32am
Your friend challenges you to build a small office building with dirt and rocks. Why do you feel disappointed that you cannot complete the task? You tried and learned a better way.
Last edited on Sep 17, 2014 at 3:32am
Sep 17, 2014 at 3:33am
Thanks :') maybe I'll start to learn SFML
Last edited on Sep 17, 2014 at 3:34am
Topic archived. No new replies allowed.