Skip to content

Commit 9f2ed33

Browse files
authored
Merge pull request #1124 from Fede5432/patch-20
Update stringmanipulation.md
2 parents 93574b0 + a4280e6 commit 9f2ed33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/docs/tutorials/stringmanipulation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ message_3[4] = 'o';
119119
message_3[5] = '\0';
120120
```
121121

122-
There, we assigned for each slot on the `message_3` array a character, this won’t work if you were to declare a sting with no definitive size, note that to represent a single character, it ought to be written between two single quotations (`'`), also, notice how we started with slot 0, and it’s only natural, considering how I emphasised on how a string is an array of characters, meaning, that the first slot is always 0, and the last one is its size minus 1 (_the null character does not count_), which in this case is 4, counting from 0 to 4, that makes it 5 characters, with the sixth being the null terminator, more on that comes later.
122+
There, we assigned for each slot on the `message_3` array a character, this won’t work if you were to declare a string with no definitive size, note that to represent a single character, it ought to be written between two single quotations (`'`), also, notice how we started with slot 0, and it’s only natural, considering how I emphasised on how a string is an array of characters, meaning, that the first slot is always 0, and the last one is its size minus 1 (_the null character does not count_), which in this case is 4, counting from 0 to 4, that makes it 5 characters, with the sixth being the null terminator, more on that comes later.
123123

124124
You can also assign strings numbers which will be viewed as **ASCII** (_a system representing character numerically, it covers 128 characters ranging from 0 to 127, more on that [here](https://en.wikipedia.org/wiki/ASCII)_) code for a character, the same message “_Hello_” can be assigned using _ASCII_ code like this;
125125

0 commit comments

Comments
 (0)