/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
class Person {
private:
string name;
int age;
public:
Person(string name, int age) {
this->name = name;
this->age = age;
}
const string &getName() const {
return name;
}
void setName(const string &name) {
Person::name = name;
}
int getAge() const {
return age;
}
void setAge(int age) {
Person::age = age;
}
// في هذه الدالة قمنا بإستخدام الدوال getName و getAge
void putData() {
cout << "Person Name: " << this->getName() << ", age => : " << this->getAge() << endl;
}
};
int main() {
Person *p = new Person("Samir", 25);
p->putData();
return 0;
}