Skip to content

Commit 6e8fb17

Browse files
authored
Merge pull request #681 from animeshsrivastava24/patch-31
Code Highlight markup and Link colouration fix string.adoc
2 parents a816bea + 53e1e95 commit 6e8fb17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Language/Variables/Data Types/string.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ All of the following are valid declarations for strings.
3737

3838
*Null termination*
3939

40-
Generally, strings are terminated with a null character (ASCII code 0). This allows functions (like `Serial.print()`) to tell where the end of a string is. Otherwise, they would continue reading subsequent bytes of memory that aren't actually part of the string.
40+
Generally, strings are terminated with a null character (ASCII code 0). This allows functions (like `link:../../../functions/communication/serial/print[Serial.print()]`) to tell where the end of a string is. Otherwise, they would continue reading subsequent bytes of memory that aren't actually part of the string.
4141

4242
This means that your string needs to have space for one more character than the text you want it to contain. That is why Str2 and Str5 need to be eight characters, even though "arduino" is only seven - the last position is automatically filled with a null character. Str4 will be automatically sized to eight characters, one for the extra null. In Str3, we've explicitly included the null character (written '\0') ourselves.
4343

@@ -62,7 +62,7 @@ char myString[] = "This is the first line"
6262

6363
It is often convenient, when working with large amounts of text, such as a project with an LCD display, to setup an array of strings. Because strings themselves are arrays, this is actually an example of a two-dimensional array.
6464

65-
In the code below, the asterisk after the datatype `char` "`char*`" indicates that this is an array of "`pointers`". All array names are actually pointers, so this is required to make an array of arrays. Pointers are one of the more esoteric parts of C++ for beginners to understand, but it isn't necessary to understand pointers in detail to use them effectively here.
65+
In the code below, the asterisk after the datatype `link:../char[char]` "`char*`" indicates that this is an array of "`pointers`". All array names are actually pointers, so this is required to make an array of arrays. Pointers are one of the more esoteric parts of C++ for beginners to understand, but it isn't necessary to understand pointers in detail to use them effectively here.
6666

6767
--
6868
// OVERVIEW SECTION ENDS

0 commit comments

Comments
 (0)