Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 打印字符串数组元素c++;_C++ - Fatal编程技术网

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
    }