include <iostream> using namespace std; class person { char name[30]; int age; public: void getdata(void); void display(void); }; void person : getdata(void) cout << "Enter name: "; cin>> namé; cout << "Enter age: "; cin>> age; } void person :: display (void) cout << "\nName: " << name; cout << "\nAge: " << age; } int main() { person p; p.getdata(); p.display(); return 0; }
int main() {}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)