💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ #include <iostream> #include <string> using namespace std; class Maker { friend ostream& operator<<(ostream &out, Maker &m); public: Maker(int id, string name) { this->id = id; this->name = name; } public: int id; string name; }; ostream& operator<<(ostream &out, Maker &m) { cout << m.id << " " << m.name << endl; return out; } void test01() { Maker m(10, "小花"); cout << m << endl; cout << endl; } int main() { test01(); getchar(); return EXIT_SUCCESS; } ~~~