Блог пользователя Md_Rakib_Hassan_

Автор Md_Rakib_Hassan_, история, 23 месяца назад, По-английски

Is there any possible way to get a character Unicode value by CPP? I was trying it but I can't find any good article on it.
In Python, we can get it by using the ord() function. So is CPP have the same kind of function for getting a character Unicode value?

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What would you want to use it for? Do you actually need unicode characters and their values, or are basic ascii characters and their values enough for what you are trying to do?

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Just cast the character to int:

cout << (int)L'Ω';

It should output 937.