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