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
It does work right. Your expectation of the initialiser is incorrect. If you really wish to take this approach, you'll need 100 comma-separated -1s in the initialiser. But then what happens when you increase the size of the array?