Thread: escape charecter

  1. #1
    Unregistered
    Guest

    escape charecter

    ok how do can i cout the escape acharecter?

    eg "\" for the other part of his smilly face?
    Code:
    #include <iostream.h>
    
    int main()
    
    {
    	cout<<"    *****"<<endl;
    	cout<<"   *     *"<<endl;
    	cout<<"  * -   - *"<<endl;
    	cout<<" *  o   o  *"<<endl;
    	cout<<"*     |     *"<<endl;
    	cout<<" *    +    *"<<endl;
    	cout<<"  *  ___/ *"<<endl;
    	cout<<"   *     *"<<endl;
    	cout<<"    *****"<<endl;
    	cout<<"   \"happy\""<<endl;
    	return (0);
    }

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    Like this "\\"

    cout << Here comes a slash" << endl;
    cout << "\\";

  3. #3
    Unregistered
    Guest
    /me slaps himself should have tought of that!

    thx dude

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Escape sequence for &
    By 3saul in forum C Programming
    Replies: 10
    Last Post: 02-28-2006, 10:01 PM
  2. Escape Codes
    By renurv in forum C++ Programming
    Replies: 2
    Last Post: 01-01-2006, 02:01 PM
  3. Interpreting literal escape sequences from a file...
    By Sebastiani in forum C++ Programming
    Replies: 1
    Last Post: 07-08-2003, 02:00 PM
  4. Escape characters
    By The Gweech in forum C++ Programming
    Replies: 3
    Last Post: 07-09-2002, 05:38 PM
  5. Using escape sequences as user inputs
    By musayume in forum C Programming
    Replies: 4
    Last Post: 12-11-2001, 09:35 AM