Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What is the use of abstract data types? How to use it?
What is the use of abstract data types? How to use it?
Premier data type refers to data types other than the basic data type. What is a type? It is a kind of data. Basic data types are the most basic and inseparable data, generally plastic, floating point and character. Abstract data type is a new data type formed by merging several basic data types. This type is defined by users and has more functions and operations than basic data types, generally including structures and classes. In fact, to put it bluntly, abstract data types are to package some related basic data types and then use them as new data types.

As for what's the use, it's a great use. For example, to manage a person's information, if you only use basic data types, you need to define many data type variables such as name, gender, place of birth, birthday, etc., which is very inconvenient to operate. If it is implemented with abstract data, it will be simple. Just package this information into a new data type and define such a variable directly.

Classes in C++ better realize the encapsulation function, that is, classes. Class makes abstract data types more operable and truly realizes object-oriented. As for usage, as long as you have studied C++, you must know the usage of classes, right? That's how it's used. Maybe you think this operation is more troublesome now, and it's not as concise as C language. But when you really enter the company one day, you realize how great object-oriented programming is, and it can make you develop more efficiently.

At the same time, I tell you that you don't know much about responsible operation, which can only prove that your programming is not enough. In the field of programming, always remember one sentence: steel is made. It is not enough to read books or listen to the teacher explain programming. You must practice by yourself to really master it.