I would like to have this code reviewed. I am learning C++ from a C background. How would I improve this code to make it more C++ like? This is a simple program that I wrote, which is a stripped down version of the actual full program I'm writing.
#include <iostream>
using namespace std;
class Doge{
public:
Doge();
Doge(Doge&);
~Doge();
int GetAge() const { return itsAge; }
void SetAge(int age) { itsAge = age; }
private:
int itsAge;
};
Doge::Doge(){
cout << "Doge Constructor" << endl;
itsAge = 5;
}
Doge::Doge(Doge&){
cout << "Doge Copy Constructor" << endl;
}
Doge::~Doge(){
cout << "Doge Destructor" << endl;
}
Doge * Function( Doge * theDoge){
cout << "In Function" << endl;
cout << "Scott is now " << theDoge->GetAge() << endl;
}
int main(){
cout << "Make Doge" << endl;
Doge Scott;
cout << "Scott is " << Scott.GetAge() << endl;
Scott.SetAge(10);
Function(&Scott);
cout << endl;
return 0;
}