하기 소스 코드에서 케이스 1은 컴파일오류없이 정답처리 되었으나, 케이스 2는 컴파일오류가 나는 이유가 궁금합니다.
오류 내용
note: candidate function not viable: no known conversion from 'value_type' (aka 'char') to 'const string' (aka 'const basic_string<char, char_traits<char>, allocator<char>>') for 1st argument _LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);
ratehog 2년 전
하기 소스 코드에서 케이스 1은 컴파일오류없이 정답처리 되었으나, 케이스 2는 컴파일오류가 나는 이유가 궁금합니다.
오류 내용
note: candidate function not viable: no known conversion from 'value_type' (aka 'char') to 'const string' (aka 'const basic_string<char, char_traits<char>, allocator<char>>') for 1st argument
_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10);