00:00
00:00
Newgrounds Background Image Theme

BorfDoggo just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

C# List variable trivia?

936 Views | 1 Reply
New Topic Respond to this Topic

C# List variable trivia? 2016-11-01 04:17:15


so i made;

char[] key = new char[7];

And then i assigned a number to each of it. (the most right ones are the ones i assigned)
but what does the numbers in the middle mean exactly? what can we do with them? are they useful?

C# List variable trivia?

Response to C# List variable trivia? 2016-11-01 08:47:21


They're the ASCII codes for each of those characters. So, when you assign '7', for example, that's really just shorthand for assigning 55 which is what represents the '7' character.

They are indeed very useful. For example, if you wanted to determine if a given character is a capital letter, you can just check if it's ASCII code is between 65 (i.e. 'A') and 90 (i.e. 'Z'). You can also shift characters around by performing arithmetic on the values, among other things.