Thread: What does" /t " do?

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    42

    What does" /t " do?

    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!
    I have a code which stops life!

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    6
    If it's '\t' that you are talking about then it's a tab.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    \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.

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    42

    Thumbs up humm!

    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
    I have a code which stops life!

  5. #5
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Its used in console too.
    Code:
    cout<<"a\tb"<<endl;
    
    Outputs
    a	b
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    42

    Thumbs up ok!

    Thanks Xsquared!

    you explained it all!
    I have a code which stops life!

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    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.

  8. #8
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Sean means \, not /
    A couple common ones are
    \t
    \n
    \\
    and \% (not sure about this one...is that right?)
    Away.

  9. #9
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    \% is not an escape sequence.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  10. #10
    Registered User
    Join Date
    Jul 2003
    Posts
    17
    \t horizontal tab, \n newline, \r carriage return, some other escape sequences. Escape sequences insert either ASCII characters or formatting characters.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. /t
    By Hugo716 in forum C++ Programming
    Replies: 1
    Last Post: 05-23-2006, 06:51 PM
  2. what does"..." prototype in C mean?
    By na_renu in forum C Programming
    Replies: 5
    Last Post: 09-17-2005, 12:53 PM