dimanche 4 octobre 2020

What is a extended Initializer list?

I have written a simple C++ program .

#include<iostream>
using namespace std;
void increment()
{     int i {0};
     static int j{0};
     i+=1;
     j+=1;
     cout << i <<"  " << j<<  endl;
}
 int main()
{  
increment();
increment();
return 0;
 }

I get the output but with the following warnings/errors,why?

extended initializer lists only available with -std=c++11 or -std=gnu++11

Which initialization is causing this?

Aucun commentaire:

Enregistrer un commentaire