Re: Change Output of Console
Use the special console API functions.
http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
You can also try using backspace. The following prints "help"
Code:
int main()
{
cout << "hello" << "\b\b" << "p " << endl;
return 0;
}
The backslash character constants are
\b backspace
\f formfeed
\n newline
\r return
\t horizontal tab
\" double quote
\' single quote
\\ backslash
\v vertcal tab
\a alert
\N octal constant
\xN hexadecimal constant
\? question mark
Re: Change Output of Console
this will print the help, but it wont print hello and then erase "lo" and replace it by "p", well yeah it does that ,but before it shows up on the screen
Re: Change Output of Console
Code:
int main()
{
cout << "hello";
Sleep(2000);
cout << "\b\b" << "p ";
return 0;
]
If you need anything more sophisticated you should be looking at the special console functions. I gave the link in post #2.
Re: Change Output of Console
Quote:
Originally Posted by
2kaud
Code:
int main()
{
cout << "hello";
Sleep(2000);
cout << "\b\b" << "p ";
return 0;
]
If you need anything more sophisticated you should be looking at the special console functions. I gave the link in post #2.
ty, this one works, I guess mine didnt work since I was using cin.get() to go to the next step and it couldn't delete previous chars since there werent any on that line... :/