-
카테고리
-
세부 분야
프로그래밍 언어
-
해결 여부
미해결
13분10초쯤에 질문이있습니다
22.03.24 06:47 작성 조회수 110
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 으로 타입캐스팅을 해주었다는 뜻인가요?
답변을 작성해보세요.
2
강민철
2022.03.24
안녕하세요 :)
std::string은 객체입니다.
관련 member function들도 있지요!
아래 링크를 참고해보세요.
https://www.cplusplus.com/reference/string/string/
감사합니다.
답변 1