I\'m trying to initialize an int array with everything set at -1.
I tried the following, but it doesn\'t work. It only sets the first value at -1.
in
Can't do what you're trying to do with a raw array (unless you explicitly list out all 100 -1s in the initializer list), you can do it with a vector:
-1
vector
vector directory(100, -1);
Additionally, you can create the array and set the values to -1 using one of the other methods mentioned.