- 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.
推薦閱讀
- Practical Data Analysis Cookbook
- Java逍遙游記
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- 深度學習:算法入門與Keras編程實踐
- Oracle Database 12c Security Cookbook
- C語言程序設計
- Building RESTful Python Web Services
- OpenCV with Python By Example
- Arduino可穿戴設備開發
- OpenMP核心技術指南
- 小程序從0到1:微信全棧工程師一本通
- 大學計算機基礎實驗指導
- Node.js區塊鏈開發
- Learning D
- HTML5游戲開發實戰