can't cout << hex << 'T'; what's wrong?

This is a discussion on can't cout << hex << 'T'; what's wrong? within the C++ Programming forums, part of the General Programming Boards category; I need to evaluate a text file by it's hexadecimal values. I found cout << hex << 16; //works ok, ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    4

    can't cout << hex << 'T'; what's wrong?

    I need to evaluate a text file by it's hexadecimal values.
    I found cout << hex << 16; //works ok, but...
    cout << hex << 'T' ; //just diplays T.
    how else can I do it?

    <win2000, MS VC++6,i386, console application.>

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    Cast 'T' to an int by putting "(int)" before it(w/o quotes).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can someone check my code and tell me what I'm doing wrong
    By jlmac2001 in forum C++ Programming
    Replies: 7
    Last Post: 09-20-2003, 08:14 PM
  2. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM
  3. cout << setiosflags(256L) << 123.123;
    By jochen123 in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2002, 10:17 AM
  4. Where is this program going wrong?
    By Kirby1024 in forum C Programming
    Replies: 8
    Last Post: 09-01-2002, 03:32 AM
  5. What am I doing wrong?
    By catmom in forum C++ Programming
    Replies: 2
    Last Post: 12-01-2001, 06:36 PM

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