#includevoid say_hello(){ std::cout << "hello world !" << std::endl;}class Hello{public: void operator () () { std::cout << "hello cpp !" << std::endl; }//重载运算符();};int main(){ say_hello(); Hello p; p(); std::cin.get(); return 0;}
本文共 301 字,大约阅读时间需要 1 分钟。
#includevoid say_hello(){ std::cout << "hello world !" << std::endl;}class Hello{public: void operator () () { std::cout << "hello cpp !" << std::endl; }//重载运算符();};int main(){ say_hello(); Hello p; p(); std::cin.get(); return 0;}
转载于:https://www.cnblogs.com/weekbo/p/8430596.html