Escape Codes

This is a discussion on Escape Codes within the C++ Programming forums, part of the General Programming Boards category; Sup? How do we display escape codes like \n on the screen? I wanted the screen to display "Escape codes ...

  1. #1
    Registered User renurv's Avatar
    Join Date
    May 2005
    Posts
    8

    Escape Codes

    Sup?

    How do we display escape codes like \n on the screen? I wanted the screen to display "Escape codes like \n rock!" on one line to no avail with:

    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    cout<<"Escape codes like \n rock!";
    return 0;
    }
    I am getting:
    Line 1: "Escape codes like"
    Line 2: "rock!"

    Thanks in advance and Happy New Year!
    Last edited by renurv; 01-01-2006 at 12:08 PM.

  2. #2
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269
    Code:
    std::cout << "\\n";
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  3. #3
    Registered User renurv's Avatar
    Join Date
    May 2005
    Posts
    8
    Thanks, SirCrono6!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. action replay codes
    By c++.prog.newbie in forum Game Programming
    Replies: 2
    Last Post: 02-28-2004, 07:47 AM
  2. Printer Escape Codes for Epson stylus color 460?
    By DanTheMan in forum C Programming
    Replies: 3
    Last Post: 02-14-2002, 09:30 PM
  3. Using escape sequences as user inputs
    By musayume in forum C Programming
    Replies: 4
    Last Post: 12-11-2001, 08:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21