Hi .

I'm new to C++ \ programming and i'm reading the C++ Primer plus 5th edition . I need help with following statement :


Cout << My name is P \u00 hex hex hex hex " ;

for the first , i can't find the ISO 10646 code charts on google and when i thought i found one , it appeared that sometimes , my c++ compiler ( from blodsheed software , DEV C++ ) , displayes some other character.

1. Where can i find a ISO 10646\ Universal character names Code charts ?

2. What shoud i do with my c++ compiler ?

3. do any of those questions above make sense ? ( i don't no if i'm asking right questions.

Thanks for your time.

google for ASCII Chart -- there are millions of them on the net. Then in C++ code \xHH is hex code, like this

cout << "Hello my name is \x4d\x65" << endl;

1. Where can i find a ISO 10646\ Universal character names Code charts ?

If you're on Windows, you could use the windows character map. Make sure that you select the font which matches that of your output window.

If you're on Windows, you could use the windows character map. Make sure that you select the font which matches that of your output window.

that is useless for this purpose because it does not show the hex and octal values for each ascii character.

// ISO/IEC 10646:2003(E) is available for free download from http://standards.iso.org/ittf/PubliclyAvailableStandards/c039921_ISO_IEC_10646_2003(E).zip
// unicode 5.0 has the same character repertoire as 
// ISO/IEC 10646:2003 with Amendments 1 and 2 applied.
// in g++ and microsoft c++, wchar_t is unicode 5.0. using either,

#include <iostream>
#include <string>
using namespace std ;

int main()
{
  wstring name ;
  wcout << L"name: " ;
  getline( wcin, name ) ;
  wcout << L"name is: (hex) " << showbase << hex ;
  for( size_t i=0 ; i<name.size() ; ++i ) wcout << int(name[i]) << L' ' ;
  wcout << L" (oct) " << showbase << oct ;
  for( size_t i=0 ; i<name.size() ; ++i ) wcout << int(name[i]) << L' ' ;
  wcout << L" (" << name << L")\n" ;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.