C and object?

Source: Internet
Author: User

LearningProgramWhen do we start to have the object concept? Start with learning C ++ and hear the word object-oriented (OOP ). I am afraid that many people have come up with the definition of "object"-I remember it is probably "abstraction of things with common attributes"-so many people think they "understand" object-oriented, some people even know that in programming, objects are encapsulated by classes, so they often stick to "Object-Oriented Programming" and become a high-level language programmer.

After talking about this, you probably heard what I was suggesting. Yes, as you are worried about, if you understand "object" and "class" as I said just now, it can be said that you are totally misled by the descriptive language called "plump" by the textbook author-even some people are intimidated by this obscure definition and give up being a programmer.

Give another suggestion: Machine-levelCode(Or machine/system), that is, the combination of some 1/0, does not know what the "class" is, the so-called C ++ class (I suppose you know C ++) three-level protection for data members (private/shared/protected) is only implemented during compilation. In other words, if a perverted compiler author ignores these three keywords completely, therefore, the so-called "encapsulation" does not have any protection effect.

Back to the "object" discussion, what is "object" now? Objects are a combination of programs and data. C ++ is known as "Object-Oriented", that is, it provides support in syntax. If you have enough knowledge about the relationship between data and operations in your program, c can also be used to implement "objects". However, if you do not know the relationship, that is, using C ++ and a more advanced "Object-Oriented" language, how can you "abstract" and define a reasonable "class?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.