+ 4

Why my code is not working properly?

My code is if someone enter a string my code will return the reverse ASCII value of every character . for example if someone give a char which ASCII value is 1.It will return the char which ASCII value is 254. My code works on codeblocks but in sololearn its not working properly.I will be very grateful if someone help me .Thank you very much. Here's my code : https://code.sololearn.com/ceX9LXdkQ3Q7/?ref=app

16th Aug 2020, 5:33 PM
The future is now thanks to science
The future is now thanks to science - avatar
8 Respuestas
+ 3
Technically, true ASCII characters are only 7 bits, values 0 - 127. The first 32 (0 - 31) are non-printable control characters, and 127 is DEL. The 8-bit values 128 through 255 are adaptable for non-standardized Extended ASCII characters, and often used to add block graphics characters and international characters. Extended ASCII character sets are not universal. However they appear on your screen depends on how your console is configured. So your program works fine on SoloLearn. It just has a different extended character set than Codeblocks has. By the way, you can achieve the same inversion of values by using a bitwise not, and thereby eliminate the temp variable. Try this: string[i] = ~string[i];
16th Aug 2020, 7:09 PM
Brian
Brian - avatar
+ 3
AteFish🇧🇩 ,ASCII (which stands for American Standard Code for Information Interchange) is a character encoding standard for text files in computers and other devices. Every char has it own ASCII value in decimal There are 255 ASCII value of a char .My code will reverse the ASCII value.It means my code will work with this logic, 255-string[i] which will reverse the value of every char. More information on: https://www.techonthenet.com/ascii/chart.php
16th Aug 2020, 5:58 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 3
https://code.sololearn.com/cC0Fe2WIX10c/?ref=app encoding problem ? i'm not sure
16th Aug 2020, 6:06 PM
Taste
Taste - avatar
+ 1
Thank you everyone for your help and contribution.
17th Aug 2020, 1:50 AM
The future is now thanks to science
The future is now thanks to science - avatar
0
You must have written the wrong codes or you have not put the starting and ending see
18th Aug 2020, 4:31 PM
Abhinav kumar
Abhinav kumar - avatar