PracticeDev/study_cpp/cpp_primer_source_code/Chapter 9/namesp.h

28 lines
500 B
C
Raw Normal View History

2022-12-20 17:31:11 +08:00
// namesp.h
#include <string>
// 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 ar[], int n);
}