0
문자열 배열에서 요소를 인쇄하려고합니다. 오류가있는 곳의 주석을 달았습니다.문자열 배열 요소 인쇄하기 C++
얻기 오류 :
IntelliSense: no operator "<<" matches these operands operand types are: std::ostream << const std::string
error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::string' (or there is no acceptable conversion)
#include <iostream>
using namespace std;
int main()
{
int day = 5, year = 2015;
const string months[13] = { 0, "January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December" };
cout << months[5] << " " << day << ", " << year << endl; //the first << is the issue
}
감사합니다. 문자열을 추가 한 후에 다른 문제가 발생합니다. 디버그 어설 션이 실패하고 중단해야합니다. 왜 이런 일이 일어나는 지 아십니까? – reezolv
또한, 중단에 대한 오류가 잘못된 널 포인터라고 말했다. – reezolv