Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8
Hey! Bugs are just unintended features!
23rd Feb 2021, 11:38 PM
builderdev212
builderdev212 - avatar
+ 9
Here's something: cout<<"\0" // Null value cout<<"\1" // a non printable value cout<<"\2" // a non printable value cout<<"\11" // horizontal tab So the output depends on how compiler prints these non printable characters . These all values are being treated as octal values even though they are not starting with literal 0 and It amazes me. Here's the list of what's printable and what's non printable https://web.itu.edu.tr/sgunduz/courses/mikroisl/ascii.html
24th Feb 2021, 4:13 AM
Hima
Hima - avatar
+ 6
it's probably a mix of sololearn output capture system and output display, wich would introduces some quirks ^^
23rd Feb 2021, 10:29 PM
visph
visph - avatar
+ 5
It's called kerning ;)
24th Feb 2021, 8:12 AM
::sк::
::sк:: - avatar
+ 5
Maybe need to code yourself a few laxatives 😉
25th Feb 2021, 11:44 AM
Mike
Mike - avatar
+ 4
:D not really... I think rather a sololearn bug ;P
23rd Feb 2021, 11:02 PM
visph
visph - avatar
+ 4
Diglett With Top Hat like I have pointed out already : "These all values are being treated as octal values..." So anything not in between [0,7] is an unknown escape sequence . here's the complete this http://www.asciitable.com/
25th Feb 2021, 1:33 AM
Hima
Hima - avatar
+ 4
Hima Yeah, after I posted that answer I played with the code a little more, and found out that you can trigger errors related to octal values, the error that the compiler throws out says "warning: octal escape sequence out of range". Also, thanks for the link, it all makes sense now.
25th Feb 2021, 1:44 AM
Diglett With Top Hat
Diglett With Top Hat - avatar
+ 3
while easter egg are hidden features ^^ in both cases, they are almost unuseful... if not annoying :(
23rd Feb 2021, 11:41 PM
visph
visph - avatar
+ 3
😂 good job. You have introduced colon letter spacing.
25th Feb 2021, 4:01 AM
Charan Leo25
Charan Leo25 - avatar
+ 2
It's because you had cout<< "\1"; Remove it and it works normal
23rd Feb 2021, 9:17 PM
Pieter Edwards
Pieter Edwards - avatar
+ 2
It's to do with the OCT value in the ascii table
23rd Feb 2021, 9:25 PM
Pieter Edwards
Pieter Edwards - avatar
+ 2
I'm unsure with that one. It could be perhaps a letter gets defaulted to a number 1 in the compiler? Or perhaps something else completely
23rd Feb 2021, 9:41 PM
Pieter Edwards
Pieter Edwards - avatar
+ 2
like Pieter Edwards said, it seems to have something to do with ascii, i tried changing the value of cout << "\1"; to something like cout << "\126"; and it printed a letter, I think it prints the letter V (it only replaces the first character of the sentence though), also, don't try changing it to values like 80 or 90 because your code will error out saying "warning: unknown escape sequence".
24th Feb 2021, 10:23 PM
Diglett With Top Hat
Diglett With Top Hat - avatar
+ 1
Copied and pasted the code in Visual Studio 2017 and it printed out the following: :::::::::: ☺:::::::::: has contemplated the "\1" to the emoji icon! Tested the same code in the Repl which runs on clang++-7 and it skipped the "\1" and only printed 2 rows of ":" Did you mean to print the emoji? what was the purpose of using the "\1" ?
24th Feb 2021, 3:59 AM
M Irdmousa
M Irdmousa - avatar
+ 1
Mike 😂
25th Feb 2021, 12:02 PM
Pieter Edwards
Pieter Edwards - avatar
+ 1
ChillPill ... I would challenge you but it may result in a new ascii emoji worse than a certain brown, smiling emoji; and pretty sure it may earn a ban from sololearn lol
25th Feb 2021, 4:02 PM
Mike
Mike - avatar
+ 1
Fortis Militis how did you set path to clang??
25th Feb 2021, 6:58 PM
VṢtēphen
VṢtēphen - avatar