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

Using Variables and Types

In this chapter, we look at the basic building blocks of a Rust program, like variables and types. We discuss variables of primitive types, whether their type has to be declared or not, and the scope of variables. Immutability, one of the cornerstones of Rust's safety strategy, is also discussed and illustrated.

We will cover the following topics:

  • Comments
  • Global constants
  • Values and primitive types
  • Binding variables to values
  • Scope of a variable and shadowing
  • Type checking and conversions
  • Expressions
  • The stack and the heap

Our code examples will center on building a text-based game called Monster Attack.

主站蜘蛛池模板: 区。| 将乐县| 东乡县| 刚察县| 盐边县| 枣阳市| 海盐县| 高尔夫| 大竹县| 林甸县| 华坪县| 建德市| 安塞县| 白城市| 金川县| 海安县| 布拖县| 资兴市| 苍南县| 石河子市| 衡水市| 化德县| 丽水市| 纳雍县| 北宁市| 长垣县| 华宁县| 绿春县| 奎屯市| 万宁市| 永仁县| 资源县| 思茅市| 湖南省| 泰安市| 庆城县| 深州市| 抚宁县| 济宁市| 新昌县| 房产|