- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 83字
- 2021-07-02 23:07:15
How can we tell the compiler that we want x to be an int?
Rust has a way of informing both the compiler and the developer of the variable type. For example, for a 32-bit int, we would use the following:
let x = 1i32;
In other words, x = 1, a 32-bit signed int.
If a variable is defined without the i32 (or any other value), the compiler will decide the type depending on how the value is used, defaulting to i32.
推薦閱讀
- 企業級Java EE架構設計精深實踐
- Oracle 11g從入門到精通(第2版) (軟件開發視頻大講堂)
- FreeSWITCH 1.8
- Debian 7:System Administration Best Practices
- PHP 7底層設計與源碼實現
- R語言數據可視化實戰
- Blockly創意趣味編程
- 教孩子學編程:C++入門圖解
- Python Data Analysis(Second Edition)
- Java程序設計
- 響應式架構:消息模式Actor實現與Scala、Akka應用集成
- JSP程序設計實例教程(第2版)
- Python入門很輕松(微課超值版)
- 深度學習程序設計實戰
- JBoss AS 7 Development