+ 3
Why My Code Doesn't Work!?
When I want to compile this code using SoloLearn CodePlayground, compiler says Compilation Error! https://code.sololearn.com/cDlhqQlZ91ZS/?ref=app https://code.sololearn.com/cDlhqQlZ91ZS/?ref=app
7 Respostas
+ 4
But why keyboard is matter!? @Happy to help. Are they different in writing code!!!
+ 3
Oh, Thank you both So Much! Really, an awkward and invisible bug! I have edit and corrected my code according to your advice. But, why it still doesn't work. I checked your codes, both working properly, but mine not!! Please check my code once again.
https://code.sololearn.com/cDlhqQlZ91ZS/?ref=app
+ 3
No PC @Alex. Written just using SoloLearn CodePlayground. It's very strange that why your code works properly, did you change something else in code other than Prototype Char Miss?
+ 3
https://code.sololearn.com/cGGLzCue2fpx/?ref=app
This code posts all 256bit ASCII chars. As you can see there are several that would look like spaces, but aren't. And this is just ASCII. In UTF-32 there are way more such characters. It can totally happen that a keyboard uses the wrong value for space and a certain app doesn't know how to interpret it. The program doesn't see spaces, characters or symbols. It just sees the encoded characters and uses them to check if an expression is valid or not.
Even in the same code this can lead to problems. If you take a wstring as input and try to compare it to a normal string in an if statement you will get false even if they are the same for humans. Your PC/smartphone just doesn't know that they are different if it's not explicitly told so.
Computers are stupid after all. ^^
+ 1
I just deleted the spaces where the errors came up and reindented the lines. You could try to use another keyboard. Download Gboard or some other free keyboard.
0
You have some invalid characters in your code. They look like spaces, but are actually not printable characters.
Beside that the code works.
Copy&paste your corrected code here:
https://code.sololearn.com/cQPthdW583KX/?ref=app
edit:
oh yes and that missing char in the prototype. Totally forgot to mention it. Happy was faster :P
0
Same error. Did you write it on a PC or in the app?