aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/os/raw/char.md
diff options
context:
space:
mode:
authorlinouxis9 <[email protected]>2018-05-07 15:31:54 +0200
committerlinouxis9 <[email protected]>2018-05-07 15:35:20 +0200
commit4901431b02227416b08e5fbc9a7ac3f5ac2f44a7 (patch)
tree7fb75cf805b8f0e9b7f169af37c9d2aa0c4aded6 /ctr-std/src/os/raw/char.md
parentMerge pull request #66 from FenrirWolf/swkbd (diff)
downloadarchived-ctru-rs-4901431b02227416b08e5fbc9a7ac3f5ac2f44a7.tar.xz
archived-ctru-rs-4901431b02227416b08e5fbc9a7ac3f5ac2f44a7.zip
Update for latest nightly 2018-05-06
Diffstat (limited to 'ctr-std/src/os/raw/char.md')
-rw-r--r--ctr-std/src/os/raw/char.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/ctr-std/src/os/raw/char.md b/ctr-std/src/os/raw/char.md
new file mode 100644
index 0000000..9a55767
--- /dev/null
+++ b/ctr-std/src/os/raw/char.md
@@ -0,0 +1,11 @@
+Equivalent to C's `char` type.
+
+[C's `char` type] is completely unlike [Rust's `char` type]; while Rust's type represents a unicode scalar value, C's `char` type is just an ordinary integer. This type will always be either [`i8`] or [`u8`], as the type is defined as being one byte long.
+
+C chars are most commonly used to make C strings. Unlike Rust, where the length of a string is included alongside the string, C strings mark the end of a string with the character `'\0'`. See [`CStr`] for more information.
+
+[C's `char` type]: https://en.wikipedia.org/wiki/C_data_types#Basic_types
+[Rust's `char` type]: ../../primitive.char.html
+[`CStr`]: ../../ffi/struct.CStr.html
+[`i8`]: ../../primitive.i8.html
+[`u8`]: ../../primitive.u8.html