Printing chars to console and to a *.txt file

This is a discussion on Printing chars to console and to a *.txt file within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm parsing a website and I'm trying to print out a character - it prints ┬ ( 194 dec ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Location
    France
    Posts
    747

    Printing chars to console and to a *.txt file

    Hi,

    I'm parsing a website and I'm trying to print out a character
    - it prints ┬ ( 194 dec = C2 hex ) to the console
    - in a file it prints (there isn't even an ASCII character like this)
    - and prints -62 to the console if I use (int) before it

    I cant see any connection between these numbers.
    Apparently 194 and -62 prints out the same character.
    194 -256 = -62
    I'm a bit confused.
    Compiler MSVC++ 2010 with Code::Blocks.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    2,560
    What character set is the HTML page using?

    What is the type of the variable you are trying to retrieve these characters into?

    Jim

  3. #3
    Registered User
    Join Date
    Dec 2007
    Location
    France
    Posts
    747
    Ok I understand, so it depends from a lot of things.
    I'm trying to retrieve it into a C++ string. The web page is Expedia.com so it's probably unicode.
    Compiler MSVC++ 2010 with Code::Blocks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble printing an array of chars
    By ppata in forum C Programming
    Replies: 8
    Last Post: 11-11-2010, 08:39 PM
  2. Replies: 2
    Last Post: 10-22-2008, 07:20 PM
  3. Printing on the console
    By balu14u in forum C Programming
    Replies: 3
    Last Post: 04-02-2005, 10:40 PM
  4. Bitmap Printing In Console C++
    By LostNotFound in forum Windows Programming
    Replies: 1
    Last Post: 03-10-2003, 07:14 AM
  5. Printing In Console C++
    By LostNotFound in forum C++ Programming
    Replies: 1
    Last Post: 02-15-2003, 04:46 PM

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