Get up to 50 % extra points for free! More info
discount week 50

Discussion: Issue with ASCII codes

Activities
Avatar
jmillberry
Member
Avatar
jmillberry:11/11/2016 14:08

I thought I understood ASCII codes from the lesson, but I don't get why casting a string to an int gives its ASCII value...

int i = (int)c;
i += shift;
// overflow control
if (i > (int)'z')
        i -= 26;
char character = (char)i;
message += character;

I know, noob alert, but can someone please tell me why that is?

 
Reply
11/11/2016 14:08
Avatar
Replies to jmillberry
Luboš 'Satik' Běhounek:11/11/2016 15:56

When you cast char to int, you get the ascii value of the char, because all chars are in memory stored as corresponding number value.

 
Up Reply
11/11/2016 15:56
Avatar
Replies to Luboš 'Satik' Běhounek
Prince Vivek Ozovehe:5/24/2017 13:23

If u cast char in to into,u will get ASCII BC all the memory is been stored corresponding number value or digit

 
Up Reply
5/24/2017 13:23
Avatar
jamaima cyrus
Member
Avatar
jamaima cyrus:9/7/2021 4:03

I'm a part-time programmer. Sometimes I even have trouble doing programming. Like in Loops. But I'm skeptical of seniors. After university, I am very busy with my job heftiness, so that's why I cannot do my essay. So, I, buy essay UK and get the greatest grades.

 
Up Reply
9/7/2021 4:03
Avatar
Samuel Jackson:12/28/2021 10:17

This is actually the kind of information I have been trying to find. Thank you for sharing this information.

 
Up Reply
12/28/2021 10:17
Avatar
Chad Wick
Member
Avatar
Chad Wick:29. March 8:08

ASCII codes in loops causes most issues and also when you use them in array they will become more volatile. A friend of my was working on nursing software and while documenting he needs nursing assignment help so that he can represent and issue was with some ascii values.

 
Up Reply
29. March 8:08
Avatar
Tracy Duff
Member
Avatar
Tracy Duff:22. June 15:10

Hey, it’s you, pay to do my assignment ! If you want to stay on point, you should create an outline. Make it simple and clear to be helpful. Do it right before you start writing, actually. You can start your outline with pointing these few main subheads. Also, write down some interesting ideas from your research.

 
Up Reply
22. June 15:10
Avatar
Chad Wick
Member
Avatar
Chad Wick:25. June 3:47

Learning ASCII through programming language is the most difficult task I have ever faced In my student life. Seriously, I always used to stuck with my assignments, but somehow I used to manage them on my own, but recently I got stuck with this assignment and you know what, I even had to find Assignment Assistance UK - based service to complete it.

Edited 25. June 3:48
 
Up Reply
25. June 3:47
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

8 messages from 8 displayed.