despaired, businessman, business @ Pixabay

In this article, I’ll show you the difference between character literals and string literals. Once you understand how to use them, you can then decide which one is best for your specific situation. The difference between a character literal and a string literal is that a character literal stores an individual ASCII code number while a string literal stores text characters. In other words, the string literal “This is a sentence” will store 12 characters (including spaces). A character literal ‘T’ stores just one. If you want to use a particular character in your code, then you can do so by using its ASCII code number with either a char variable or as part of an int variable’s type specifier. So for instance @c means that c must be stored as an ASCII value and not simply interpreted as text (it would interpret it differently depending on what language the computer uses internally). This also applies when storing numbers into variables because they are effectively considered strings! The following example shows how this works: @e = 65; //stores letter e at position 65 on

LEAVE A REPLY

Please enter your comment!
Please enter your name here