65,208
社区成员
发帖
与我相关
我的任务
分享// ConsoleApplication3.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
#include <initializer_list>
using namespace std;
void display(initializer_list<int> arguments) {
for (auto p = arguments.begin(); p != arguments.end(); ++p) {
// *p = *p * 2; → Not allowed to modify data
cout << *p << "\n";
}
}
int _tmain(int argc, _TCHAR* argv[])
{
display({ 3, 77, 8, 1, 9 });
return 0;
}