cpp 예외처리

박호준·2021년 9월 15일
0
int a;
try{
	if (a < 0)
    	thrwo a;
        
	std::cout << "a 는 양수" << std::endl;
}
    
catch (int a){
	std::cout << "a 는 음수" << std::endl;
}
	
profile
hopark

0개의 댓글