Placing special characters inside a string

This is a discussion on Placing special characters inside a string within the C Programming forums, part of the General Programming Boards category; I want to put the following sequence of characters inside a string: <escape key>reset<escape key> Is this possible? Thanks....

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    2

    Placing special characters inside a string

    I want to put the following sequence of characters inside a string:
    <escape key>reset<escape key>

    Is this possible?

    Thanks.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    <escape key> - is this a character? or just a button on your keyboard?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You can place ANY character in a string using '\nnn' or '\0xhh', where nnn is an octal number or hh is a hex number.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    2
    Yes, the escape button on my keyboard.
    The ASCII code is 27, so I'll try it out.
    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  3. Replies: 4
    Last Post: 03-03-2006, 01:11 AM
  4. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  5. Another overloading "<<" problem
    By alphaoide in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2003, 10:32 AM

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