string i = "unknown";
cin >> i;
cout << i << endl;
is the WAY but i not make exactly this is more complexy.
i make a Menu, this menu is to change the "Name" of a string pressing Enter, left, right.
but, is flicking, because then write and clean.
how to fix ?
i can't make the program wait one second, i make a menu and i want, This menu to be very proximity to real time.
and i tryed to make wih 200 not work :(
i think i'll overwrite the text, but how i do that ?
static HANDLE hout;
hout= GetStdHandle(STD_OUTPUT_HANDLE);//Get the handle of the standard output
void gotoxy(unsigned x,unsigned y)//Set cursor Position
system("pause");//Without pause, the program will run too fast for user to see clearly
gotoxy(0,0);//Return cursor to up-left corner
//Well, maybe I shoud clean the screen first to make sure no words is uncovered. But here the second sentence is longer than the first, and can cover the first completely.
cout<<"I'm a Chinese.";
By the way, you turely can use system("cls") instead of my function, but you forgot to use system("pause") , and your program cleaned the screen before you saw it clearly.
What's more, you can usewhile(1) or while(ture) instead of while(1<2). while(1<2) will make others baffled.
yep is a scroll menu.
ok but there is a problem, i used a while and the "way" of you suggested,
therefore my program is writing all the screen, example :
but now dont flicking but is writing in my entire screen.
i have an idea now, how i can change a text foreground to black ?
if is another color i can use :
SetConsoleTextAttribute(hConsole, FOREGROUND_ ...
but isn't, how can i do this ?
i don't want the words flicking !
and, using the example up, is writing im my entire screen, but, if i put a system("cls") back to flick :(
Why it is writing in your entire screen? It only changes the first line.
Well, please describe what you want in detail.
ex. print "Hello, world!" on first line and then change it into "I'm I'm Alive" without flicking after press any key.
On my computer, this code works well. I just don't know what