#include <iostream>
#include <string>
usingnamespace std;
class books{
public:
void setName(string name){
name = The New Particle;
}
string getName(){
return name;
}
void setDate(int date){
date = 12/03/1963;
}
int getDate(){
return Date;
}
private:
string bookName(string name);
int releaseDate(int date);
};
Hi. Above is an example of using Set & Get methods. However, I have hit a brick wall, as I don't fully understand, if one has to call the Set & Get method in the main function or it is fine not to call the Set & Get method in the main function?
Does this code Date.get return the date or does it do something else?
Sorry for the long essay. I have watched instructional videos on YouTube and read a book, but I am still confused.
I appreciate any help given and would like to thank everyone taking their time to help.