Files
OOP-Cpp/oop_hw4/hw4/man.cpp
2025-08-11 00:01:30 +08:00

34 lines
471 B
C++

#include <iostream>
#include "woman.h"
#include "man.h"
using std::string;
using std::cout;
using std::cin;
using std::endl;
man::man() {
name = "";
married = false;
w = NULL;
}
man::man(string n, bool m, woman* x) {
name = n;
married = m;
w = x;
}
void man::marry(woman* x) {
w = x;
married = true;
}
void man::devorce(woman* x) {
w = NULL;
married = false;
}
string man::display() {
return name;
}
woman* man::show() {
return w;
}