What is a Class and Object in C++?

c++

Question

What is a Class and Object in C++?

Can we say that a Class is an Object?

1
14
5/30/2017 1:51:17 AM

A Class is like a blueprint, an object is like a house built from that blueprint.

You can have many houses with the same layout/floorplan (read class), but each is it's own instance (read object). Each has it's own owner, furniture, etc.

Note that there are also objects whose blueprint is not a class (e.g. integers).

48
2/12/2017 11:20:55 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon