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

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.

主站蜘蛛池模板: 清流县| 辽阳市| 乾安县| 靖边县| 奉节县| 阿图什市| 芷江| 盘锦市| 桃园县| 普定县| 瓮安县| 廉江市| 南安市| 山丹县| 巴东县| 七台河市| 科技| 自治县| 罗江县| 石渠县| 嵊泗县| 晋城| 凤凰县| 卓资县| 钟祥市| 应用必备| 南江县| 哈巴河县| 鄱阳县| 资中县| 凤庆县| 临汾市| 阳信县| 湘潭市| 苏尼特左旗| 海晏县| 扬中市| 元谋县| 威信县| 西林县| 巫溪县|