CLion中写到for each 时,each下方显示错误,提示信息是 Excepted "(" after "for".
运行程序后,下方提示“error C4496: 使用了非标准扩展“for each”: 替换为 ranged-for 语句”
#include <iostream>
using namespace std;
int arra[5] = {5,4,3,2,1};
void first()
{
for each (int num in arra)
{
std::cout << num << "\t";
}
}
求大佬解惑