C++ 打印字符串数组元素c++;
正在尝试打印字符串数组中的元素。已标记错误所在的注释 获取错误:C++ 打印字符串数组元素c++;,c++,C++,正在尝试打印字符串数组中的元素。已标记错误所在的注释 获取错误: IntelliSense:无操作员“你没有#包括,你很幸运,在中找到了的某些部分,因此你可以申报月份你没有#包括,你很幸运,在中找到了的一些部分,因此你可以声明月份你没有包括,你很幸运在中找到了的一些部分,这样你就可以声明月份你没有包括,您很幸运,在中找到了的某些部分,因此您可以申报月份好的,谢谢。在我添加字符串之后,出现了另一个问题。我得到调试断言失败,必须中止。知道为什么会这样吗?好的,谢谢。在我添加字符串之后,出现了另一个问
IntelliSense:无操作员“你没有#包括,你很幸运,在
中找到了
的某些部分,因此你可以申报月份你没有#包括,你很幸运,在
中找到了
的一些部分,因此你可以声明月份你没有包括,你很幸运在
中找到了
的一些部分,这样你就可以声明月份你没有包括,您很幸运,在
中找到了
的某些部分,因此您可以申报月份
好的,谢谢。在我添加字符串之后,出现了另一个问题。我得到调试断言失败,必须中止。知道为什么会这样吗?好的,谢谢。在我添加字符串之后,出现了另一个问题。我得到调试断言失败,必须中止。知道为什么会这样吗?好的,谢谢。在我添加字符串之后,出现了另一个问题。我得到调试断言失败,必须中止。知道为什么会这样吗?好的,谢谢。在我添加字符串之后,出现了另一个问题。我得到调试断言失败,必须中止。知道为什么会这样吗?
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
}