Can't sleep properly...
I'm a newbie C programmer and am having trouble using sleep(i); whilst trying to write to a single line. Im using said function inside a for loop.
To write to the same line I use \r.
Everytime I compile and run the exe, nothing is displayed on the screen until the program has finished executing.
what is the '/_' thing do anyway?
i mean '\_' thing do anyway?
It makes you ask questions ;)
use a backslash '\' for an escape sequence. The Compiler will not print it. in your string say \n somewhere and it will go to the next line. use \t and it will skip 5 spaces(\t means tab). If you want to print a backslash, then type this:
cout << "Hi There!" << endl;
cout << "I'm on the next line!\n";
cout << "So am I! wait...but where's the endl?";
That should print:
cout << "Bonjour!\\Hello!\n";
cout << "Je m'eppelle Spongebob.\n\\\nmy name is SpongeBob.";
Je m'eppelle Spongebob.
My name is SpongeBob.
You can also use it to make a beep eg.
cout << "Hello, BEEP \a" << endl; \\ or \n