Skip to content
← Back to Community
What character encoding is used in repl for C++?
Profile icon
hacker
has Hacker Plan
douglasatkinson

I want to output the obelus (division sign) to the monitor. The following code should do it.

char div_sign ='\366'; cout << div_sign << endl;

This works in Visual Studio and from what I can find out it should work with any compiler. However, I do not get the correct output. The only thing I can think of is the repl does not use the OEM character set. Any suggestions to get this to work correctly in repl?
Thanks,
Doug

Voters
Profile icon
douglasatkinson
Comments
hotnewtop
Profile icon
Highwayman

Copy paste the character into the repl to use instead of using the character’s ascii code. Generally works. 🤷‍♂️

Profile icon
DynamicSquid

I think why it's working on VS is because it automatically changes '\366' into another type... Don't take my word for it though

Profile icon
SixBeeps

Unicode I believe, but follow what

@Highwayman
said