Home > Back-end >  Typedef some confusion
Typedef some confusion

Time:09-25

Such as in the beginning of the program written like this:
Typedef int MazeType [5] [6].
MazeType m;
The first sentence is what mean? Not that typedef but some existing variable a new name, it is defined by an array of type int
Since the first sentence defines an array, so the second sentence?

CodePudding user response:

Declare MazeType is a two-dimensional array type alias
Define variables m

CodePudding user response:

Typedef int MazeType [5] [6].
MazeType m;

Equivalent to int m [5] [6]

CodePudding user response:

Basically is to use substitution method, see a few times also become accustomed to,

CodePudding user response:

This syntax is too upset, general grammar books are vague

CodePudding user response:

reference 4 floor qq_32457929 response:
this syntax is too upset, general grammar books are vague


Don't upset oh,, when you write programs kind enough, you will find that, at the time of writing some programs, see that a long list of type name is really a headache,,

For example:
List : : iterator m_itrListUser;
Every time to define an iterator for the container, it takes so long to write type name,,,

But if at the beginning of the program to change the name:
Typedef list : : iterator itrIntList;

So then I only need to write:
ItrIntList m_itrListUser;
Good,,

Beautiful Angle, no matter from the code or legibility, or typing efficiency, has promoted,,

CodePudding user response:

Typedef int MazeType [5] [6].
Can look like this:
Remove the typedef and MazeType, MazeType type is int [5] [6]

CodePudding user response:

Before studying the data structure to discrete mathematics learning?
  • Related