Skip to main content

Setter and Getter functions in C++

Body

Setter and Getter functions in C++

In this part you will learn: 1. How to make an object of class in C++ 2. What are Setters 3. What are getters 4. To use setters and getters 5. Basic C++ syntax How to make an object of class in C++? Whenever we want to make an object of the class we first define its class and then in the main of the program we write name of the class followed by the name of the object we want to make. e.g to make an object we write the code as class anyclass{ //data members and functions }; int main { anyclass myobj; } In the above code we have created

Comments

Submitted bykingpeace (not verified)on Fri, 03/16/2018 - 01:33

Frankly ,this article is very helpful for me ,and i think that it is beneficial to the others .thank you author!

Add new comment

File attachments
Screenshot