Detailed Explanation of "C Language Structural Arrays" Review of Upgrading Computer Science (First Draft)

Detailed explanation of C language structure array (with example demonstration)


 

The so-called "structure array" means that each element in the array is a structure

In practical applications, it is often used to represent a group with the same data structure, such as: students in a class, all employees in a restaurant, etc.!

In C language, the definition of "struct array" is similar to the way of defining "struct variable"

details as follows:

struct frame {

    char *name;//name

    int num; //student number

    int age;//age

    char group;//The group

    float score;//score

}class[5];//Indicates that there are 5 students in a class

Structure arrays can also be initialized at the same time as they are defined

For example

str

Guess you like

Origin blog.csdn.net/weixin_51563198/article/details/122787465