I remember that I saw a code that had something like this..
Code:cout << "something_Here" << "/t" << endl;
what does " /t " do ??
I'll look for that code in my computer, maybe I can post it..
Thanks!
Printable View
I remember that I saw a code that had something like this..
Code:cout << "something_Here" << "/t" << endl;
what does " /t " do ??
I'll look for that code in my computer, maybe I can post it..
Thanks!
If it's '\t' that you are talking about then it's a tab.
\t prints out a tab which is an undefinable ammount of space that aligns the next section of output to a horizontal tab on the screen.
oh.. ok , I think you're right, it's " \t "
but that's only used in GUI, right?
I've never used tab in console..
Thanks for your reply;)
Its used in console too.
Code:cout<<"a\tb"<<endl;
Outputs
a b
Thanks Xsquared!
you explained it all!
Special characters that begin with '/' are called escape characters, and just insert formatting commands. Some insert a new line, some go to the beginning of the new line, and /t is just one of those. I actually think that it may be used more in console than in GUI.
Sean means \, not /
A couple common ones are
\t
\n
\\
and \% (not sure about this one...is that right?)
\% is not an escape sequence.
\t horizontal tab, \n newline, \r carriage return, some other escape sequences. Escape sequences insert either ASCII characters or formatting characters.