인프런 커뮤니티 질문&답변
13분10초쯤에 질문이있습니다
작성
·
186
0
try
{
if(x<0.0)throw string("Negative input);
cout<<sqrt(x)<<endl;
}
catch(string error_message)
{
court<<error_message<<endl;
}
이때 throw 안에있는 string("Neagtive input")은 익명객체인가요 아니면 string 으로 타입캐스팅을 해주었다는 뜻인가요?
답변 1
2
안녕하세요 :)
std::string은 객체입니다.
관련 member function들도 있지요!
아래 링크를 참고해보세요.
https://www.cplusplus.com/reference/string/string/
감사합니다.





