1. 程式人生 > >C++偽函數

C++偽函數

light operator cout brush cin world say end turn

#include <iostream>


void 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;
}

  

C++偽函數