Rust Chapter 3 - Detailed Explanation of Structures, Enumerations, and Methods


foreword

The catalog of this series of tutorials can be viewed here: Rust Tutorial Catalog

The previous chapter introduced some basic syntax in Rust, and this chapter continues to learn some advanced features in Rust

1. Structure

The first thing to introduce is the structure. Its function is similar to the tuple introduced in the previous chapter. It can be used to store a series of related and different types of data.

If you know C/C++, it is basically C/C++the same as the structure in , or pythonsimilar to the dictionary in

The method of use is as follows:

struct Student{
   
    
    
    name:String

Guess you like

Origin blog.csdn.net/weixin_50964512/article/details/130324823