Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- struct Address
- {
- char country[50];
- char city[50];
- char street[50];
- char building[50];
- char flat[10];
- };
- struct Client
- {
- char name[50];
- char surname[50];
- char sex[10];
- int age;
- char IDcode[30];
- Address address;
- };
- Client client1;
- Client client2;
- Client client3;
- void input_Client(Client *obj) {
- cout << "input name " << endl;
- cin.getline(obj->name, 50);
- cout << "input surname " << endl;
- cin.getline(obj->surname, 50);
- cout << "input sex " << endl;
- cin.getline(obj->sex, 10);
- cout << "input age " << endl;
- cin >> obj->age;
- cout << "input IDcode " << endl;
- cin.getline(obj->IDcode,30);
- cout << "input country " << endl;
- cin.getline(obj->address.country,50);
- cout << "input city " << endl;
- cin.getline(obj->address.city, 50);
- cout << "input street " << endl;
- cin.getline(obj->address.street, 50);
- cout << "input building " << endl;
- cin.getline(obj->address.building, 50);
- cout << "input flat " << endl;
- cin.getline(obj->address.flat, 10);
- }
- void display_Client(Client *obj) {
- cout << "----------------------------------" << endl;
- cout << "Name: " << obj->name << endl;
- cout << "Surname: " << obj->surname << endl;
- cout << "Sex: " << obj->sex << endl;
- cout << "age: " << obj->age << endl;
- cout << "IDcode: " << obj->IDcode << endl;
- cout << "Country: " << obj->address.country << endl;
- cout << "City: " << obj->address.city << endl;
- cout << "Street: " << obj->address.street << endl;
- cout << "Bulding: " << obj->address.building << endl;
- cout << "Flat: " << obj->address.flat << endl;
- cout << "------------------------------------" << endl;
- }
- int main() {
- int ind = 0;
- Client *p;
- p = &client1;
- do {
- input_Client(p);
- display_Client(p);
- cout << "Do you want to input 1 more client?" << endl;
- cin >> ind;
- } while (ind);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement