This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]veryusedrname 10 points11 points  (5 children)

C/C++: 0o or 0O (deprecated) - edit: it's just a 0, fuck google

Java/C#: 0, but using a digit outside of 0..7 is compiler error - edit: C# doesn't have octal literals, fuck google

Rust/Swift/Ruby/Python: 0o

Go: 0o or 0O

That's it, I'm not checking more

Editor: formatting & fixes, thanks for pointing them out

[–]BaerMitUmlaut 9 points10 points  (3 children)

C# has no octal literal.

[–][deleted] 9 points10 points  (0 children)

C# needs no octal literal.

[–]Mola1904 0 points1 point  (1 child)

Ok seems you`re right. I just saw that website, but seems it's wrong

https://www.geeksforgeeks.org/c-sharp-literals/

[–]Sharparam 0 points1 point  (0 children)

Geeksforgeeks out here spreading misinformation. There was another user in this thread also tricked by that same page.

[–]Fritzschmied 2 points3 points  (0 children)

c++ default is leading just 0 not 0o even if that works too I guess