For a console application, I need to display the symbol: √
When I try to simply output it using:
std::cout << '√' << std::endl;
or
std::wcout << '√' << std::endl;
,
it outputs the number 14846106
instead.
I've tried searching for an answer and have found several recommendations of the following:
std::cout << "\xFB" << std::endl;
and
std::cout << (unsigned char)251 << std::endl;
which both display a superscript 1.
This is using the Windows console with Lucida font. I've tried this with various character pages and always get the same superscript 1. When I try to find its value through getchar()
or cin
, the symbol is converted into the capital letter V
. I am, however, sure that it can display this character simply by pasting it in. Is there an easy way of displaying Unicode characters?