#include <vector> ... //inside main function vector<int> vi3 = {42,42,42,42,42,42,42,42,42,42};
I am learning C ++, I thought it was possible to initialize such a vector ... Am I doing something wrong? I know about other ways to initialize a vector. The book I am reading says that this can also be done as follows:
vector<int> vi3{42,42,42,42,42,42,42,42,42,42};
This is the first thing in the book that gave me an error. What am I doing wrong?
source share