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

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.

主站蜘蛛池模板: 东莞市| 建平县| 合川市| 三亚市| 平山县| 华容县| 屯门区| 呼和浩特市| 烟台市| 万州区| 阳西县| 甘肃省| 新和县| 民勤县| 荆门市| 涟水县| 绵竹市| 河间市| 汾西县| 台中县| 自治县| 蓝田县| 察隅县| 牡丹江市| 体育| 邵阳市| 抚顺市| 台东县| 佛冈县| 定州市| 修武县| 文昌市| 景谷| 肥东县| 阳山县| 连州市| 化州市| 岳普湖县| 承德市| 绥滨县| 孟州市|