Thread: Printing chars to console and to a *.txt file

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

    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.
    Using Windows 10 with Code Blocks and MingW.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    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
    Posts
    932
    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.
    Using Windows 10 with Code Blocks and MingW.

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, 09: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, 11:40 PM
  4. Bitmap Printing In Console C++
    By LostNotFound in forum Windows Programming
    Replies: 1
    Last Post: 03-10-2003, 08:14 AM
  5. Printing In Console C++
    By LostNotFound in forum C++ Programming
    Replies: 1
    Last Post: 02-15-2003, 05:46 PM