mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-09 19:40:48 -05:00
Revert syntax demo, add note
So as to not overwhelm the reader with syntax that is unseen up to this point, use the original demonstration, but add an explanatory note hinting that there is more to the semantics of string literals than shown.
This commit is contained in:
parent
b61186d6a5
commit
66a1f7bb61
1 changed files with 4 additions and 2 deletions
|
@ -7,9 +7,11 @@
|
||||||
//
|
//
|
||||||
// const foo = "Hello";
|
// const foo = "Hello";
|
||||||
//
|
//
|
||||||
// Is the same as:
|
// Is almost* the same as:
|
||||||
//
|
//
|
||||||
// const foo = &[_:0]u8{ 'H', 'e', 'l', 'l', 'o' };
|
// const foo = [_]u8{ 'H', 'e', 'l', 'l', 'o' };
|
||||||
|
//
|
||||||
|
// (* We'll see what Zig strings REALLY are in Exercise 77.)
|
||||||
//
|
//
|
||||||
// Notice how individual characters use single quotes ('H') and
|
// Notice how individual characters use single quotes ('H') and
|
||||||
// strings use double quotes ("H"). These are not interchangeable!
|
// strings use double quotes ("H"). These are not interchangeable!
|
||||||
|
|
Loading…
Reference in a new issue