From 3cb1846a4f00a607d741966cce010bebba09bd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=A8=E9=83=A8=E9=83=BD=E6=83=B3=E5=AD=A6=E6=80=8E?= =?UTF-8?q?=E4=B9=88=E5=8A=9E?= <2434858409@qq.com> Date: Thu, 5 May 2022 08:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../namesp.h" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "Ch9\345\206\205\345\255\230\346\250\241\345\236\213\345\222\214\345\220\215\347\247\260\347\251\272\351\227\264/\345\220\215\347\247\260\347\251\272\351\227\264/namesp.h" diff --git "a/Ch9\345\206\205\345\255\230\346\250\241\345\236\213\345\222\214\345\220\215\347\247\260\347\251\272\351\227\264/\345\220\215\347\247\260\347\251\272\351\227\264/namesp.h" "b/Ch9\345\206\205\345\255\230\346\250\241\345\236\213\345\222\214\345\220\215\347\247\260\347\251\272\351\227\264/\345\220\215\347\247\260\347\251\272\351\227\264/namesp.h" new file mode 100644 index 0000000..b742b53 --- /dev/null +++ "b/Ch9\345\206\205\345\255\230\346\250\241\345\236\213\345\222\214\345\220\215\347\247\260\347\251\272\351\227\264/\345\220\215\347\247\260\347\251\272\351\227\264/namesp.h" @@ -0,0 +1,28 @@ +//namesp.h +#include + +//create the pers and debts namespaces + +namespace pers +{ + struct Person + { + std::string fname; + std::string lname; + }; + void getPerson(Person&); + void showPerson(const Person&); +} + +namespace debts +{ + using namespace pers; + struct Debt + { + Person name; + double amount; + }; + void getDebt(Debt&); + void showDebt(const Debt&); + double sumDebts(const Debt arr[], int n); +} \ No newline at end of file -- GitLab