목록연산자 오버로딩 (1)
컴공생의 다이어리
[c++] std::ofstream 연산자 오버로딩
#include #include #include class Human { std::string name; int age; public: Human(const std::string& name, int age) : name(name), age(age) {} std::string get_info() { return "Name :: " + name + " / Age :: " + std::to_string(age); } friend std::ofstream& operator
Development/C & C++
2021. 1. 3. 20:46