官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 祁连县| 五常市| 常德市| 楚雄市| 曲阜市| 鹰潭市| 阜城县| 申扎县| 樟树市| 育儿| 夏津县| 滁州市| 海原县| 宜都市| 格尔木市| 蚌埠市| 洞口县| 积石山| 镇平县| 台东县| 佳木斯市| 三江| 宜都市| 黎平县| 会宁县| 长岛县| 吉安县| 连城县| 东安县| 金阳县| 临湘市| 改则县| 娱乐| 山西省| 肇源县| 阿尔山市| 张家港市| 柳河县| 凉山| 乐都县| 徐闻县|