how to print unicode in c++ 11?

hello guys i am having a problem,i have to cout the unicode ★ this now the problem is when i use c++ 5.1 (online compiler ideone-com) and try to use this
1
2
  string c="\u2605";
cout<<C;

it show output ok but in visual studio 2015 it not showing correctly and i think visual studio use c++ 11

so can you guys tell me how to print it in c++ 11 or c++ 14 what ever visual studio use.
The issue isn't the compiler, it's the console. The Windows console host is notorious for being really bad at using other character encodings such as Unicode or UTF-8. It's easier to just write output to a file and use a text editor like Notepad++ than it is to try and display unicode in the console.

(If anyone knows a good way to do this, please let me know - I'm tired of Googling solutions that don't work)
Answer:
Don't use the console.

Answer:
(1) Make sure your user has set the console font to an appropriate unicode one (Lucida Unicode may not be sufficient, and it takes hacking the registry to use another font on the console),
(2) Set the console's output code page correctly (I recommend you use UTF-8),
(3) Set the locale correctly, which is difficult cross-platform,
(4) Use the correct functions to output to the console,
(5) defeat your compiler's hooks to console output modification.

Answer:
Use an asterisk instead of a star.

Good luck!
so i cant show star symbol in console ?
It's possible, but it's incredibly difficult because the Windows console sucks. C++ isn't designed for interacting with a console either, so any code you write to make it work will be non-portable.
Topic archived. No new replies allowed.