Basic Concepts C language - chain structure + + macro definition (c)

Definition of the structure and a representation of the variables

C may store a variable array defined to allow the same type of data items, the data structure is usable in another type of C programming user-defined, which allows you to store different types of data items.

Declaration of structure

In order to define the structure, you must use the struct statement. struct statement defines a new data type comprising a plurality of members, the format struct statement is:

struct 结构体名
{
类型标示符  成员名;
类型表示符  成员名;
...
}

Declaration of structure variables

1. directly after the structure declaration, for example:

struct {
...
}array[6];

2. declare type of structure, then defined individually, for example:

struct student {
...
};
struct student array[6];

3. declare a structure type name, and then type the name of the new definition of variables, such as:

typedef struct
{
...
}ST
ST array[6];

Structure variable references

Published 42 original articles · won praise 74 · views 9262

Guess you like

Origin blog.csdn.net/Miracle1203/article/details/104250390