Skip to content

Commit 9fce9bd

Browse files
Add example for Unicode Code point literal > 255
Only Basic Latin and Latin-1 Supplement code points fit into a single byte.
1 parent 1e9124b commit 9fce9bd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

exercises/059_integers.zig

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
// const a2: u8 = 0x41; // hexadecimal
77
// const a3: u8 = 0o101; // octal
88
// const a4: u8 = 0b1000001; // binary
9-
// const a5: u8 = 'A'; // UTF-8 code point literal
9+
// const a5: u8 = 'A'; // ASCII code point literal
10+
// const a6: u16 = 'Ȁ'; // Unicode code points can take up to 21 bits
1011
//
1112
// You can also place underscores in numbers to aid readability:
1213
//

patches/patches/059_integers.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
22,24c22,24
1+
23,25c23,25
22
< 0o131, // octal
33
< 0b1101000, // binary
44
< 0x66, // hex

0 commit comments

Comments
 (0)