© Carlo Milanesi 2018
Carlo MilanesiBeginning Rusthttps://doi.org/10.1007/978-1-4842-3468-6_5

5. Using Data Sequences

Carlo Milanesi1 
(1)
Bergamo, Italy
 
In this chapter, you will learn:
  • How to define sequences of objects of the same type, having fixed-length (arrays) or variable-length (vectors)

  • How to specify the initial contents of arrays or vectors, by listing the items, or by specifying one item and its repeat count

  • How to read or write the value of single items of arrays or vectors

  • How to add items to a vector or to remove items from a vector

  • How to create arrays with several dimensions

  • How to create empty arrays or vectors

  • How to print or copy whole arrays or vectors

Arrays

So far, we have seen how to store in a variable a string, a number, or a ...

Get Beginning Rust: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.