예제 #1
0
파일: main.cpp 프로젝트: CCJY/coliru
int main()
{
   employee paul("Paul","Economics");
   person  john( "Mumu");
   somefunc(paul);
   somefunc(john);
}
예제 #2
0
int main()
{
	try {
		Bureaucrat	jim("Jim", 160);
	} catch (std::exception & e) {
		std::cout << e.what() << std::endl;
	}
	try {
		Bureaucrat	jim("Jim", 0);
	} catch (std::exception & e) {
		std::cout << e.what() << std::endl;
	}

	Bureaucrat paul("Paul", 1);
	Bureaucrat annie("Annie", 150);

	std::cout << paul;
	std::cout << annie;

	try {
		paul.incrementGrade();
	} catch (std::exception &e) {
		std::cout << e.what() << std::endl;
	}

	try {
		annie.decrementGrade();
	} catch (std::exception &e) {
		std::cout << e.what() << std::endl;
	}
	std::cout << paul;
	std::cout << annie;

	paul.decrementGrade();
	annie.incrementGrade();

	std::cout << paul;
	std::cout << annie;

	return 0;
}