What is a Class and Object in C++?

前端 未结 20 990
走了就别回头了
走了就别回头了 2020-12-09 10:33

What is a Class and Object in C++?

Can we say that a Class is an Object?

20条回答
  •  情话喂你
    2020-12-09 11:00

    Class is a collection of data member and member function.

    Class is a user define data type.

    Object is a class type variable.

    Objects are also called instance of the class.

    Each object contains all members(variables and functions) declared in the class. We can access any data member or member function from object of that class using . operator.

提交回复
热议问题