From 82a5493c360cc07a5c0846b83805d271d1544ea4 Mon Sep 17 00:00:00 2001
From: garhve
There are a bunch of built-in types we can work with: scalar types and compound types. -Those scalar types are just alike as C language. -| scalar types | rust | c | -| ------------- |------------- | ------- | -| integer | i(u)8/i16/i32(default)/i64 | (unsigned) char/short/int/long | -| float | f32/f64(default) | float/double | -| boolean | true/false | True/False (non-zero/zero) | -| character | char | char |
+Those scalar types are just alike as C language. +scalar types | rust | c |
---|---|---|
integer | i(u)8/i16/i32(default)/i64 | (unsigned) char/short/int/long |
float | f32/f64(default) | float/double |
boolean | true/false | True/False (non-zero/zero) |
character | char | char |
The compound types are a bit different. rust provides many hands-on types where C type is not the same or needs to define explicitly.
compound type | rust | c |
---|---|---|
struct | same | same |