Skip to content

Commit 3d029ea

Browse files
Update string.adoc
1 parent c2c6ee3 commit 3d029ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Language/Variables/Data Types/string.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ subCategories: [ "Data Types" ]
1212

1313
[float]
1414
=== Description
15-
Text strings can be represented in two ways. you can use the String data type, which is part of the core as of version 0019, or you can make a string out of an array of type char and null-terminate it. This page described the latter method. For more details on the String object, which gives you more functionality at the cost of more memory, see the link:../stringobject[String object] page.
15+
Text strings can be represented in two ways. you can use the String data type, which is part of the core as of version 0019, or you can make a string out of an array of type char and null-terminate it. This page described the latter method. For more details on the String object, which gives you more functionality at the cost of more memory, see the `link:../stringobject[String object]` page.
1616
[%hardbreaks]
1717

1818
[float]
@@ -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)