Converting ASCII text into chars or strings.

This is a discussion on Converting ASCII text into chars or strings. within the C++ Programming forums, part of the General Programming Boards category; I am confused as to how ASCII text such as backspace and delete are represented in a file. Aren't these ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    71

    Converting ASCII text into chars or strings.

    I am confused as to how ASCII text such as backspace and delete are represented in a file. Aren't these more of text altering commands? yet how are these ASCII text represented in a file?

    I am trying to implement an algorithm for an input file of ASCII text but the backspace and delete ASCII text are confusing me as I have never seen these characters still present in a file. If I read the file in line by line and one character at a time, will these show up or should I just not worry about them.

  2. #2
    Registered User
    Join Date
    Apr 2013
    Posts
    1,342
    I'm not sure what happens if you read a file in text mode (fopen( ... "r")), but in binary mode (fopen( ... "rb")), backspace shows up as 0x08 (hex), delete as 0x7f, carriage return (dos / windows) as 0x0d, linefeed as 0x0a, ... . Link to wiki article:

    ASCII - Wikipedia, the free encyclopedia

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. joining two chars together and converting to INT
    By tehprince in forum C++ Programming
    Replies: 5
    Last Post: 12-21-2007, 02:08 PM
  2. converting ints to chars
    By e66n06 in forum C Programming
    Replies: 4
    Last Post: 07-28-2007, 04:52 PM
  3. Converting strings to chars
    By Suchy in forum C++ Programming
    Replies: 4
    Last Post: 05-06-2007, 05:17 AM
  4. converting chars to ascii equivilant
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 09-01-2001, 01:03 PM
  5. converting chars to ints
    By nebie in forum C++ Programming
    Replies: 6
    Last Post: 09-01-2001, 12:33 PM

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