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

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.

主站蜘蛛池模板: 安康市| 青浦区| 循化| 清苑县| 时尚| 长乐市| 小金县| 西丰县| 龙门县| 米林县| 玉门市| 高陵县| 沽源县| 阿城市| 无为县| 大渡口区| 花垣县| 都昌县| 新巴尔虎左旗| 柳江县| 博爱县| 平江县| 祁阳县| 兴和县| 宁强县| 莱州市| 额敏县| 民和| 兴安县| 循化| 松溪县| 庆安县| 上林县| 昌宁县| 都安| 望奎县| 曲阜市| 芷江| 宝兴县| 丁青县| 禄丰县|