+ 1

C++ arrays inizialization

Try and execute this code: https://code.sololearn.com/c1uONqAVZ5af/?ref=app without Initializing arrDigits. You'll get a lot of random results, especially if you execute code several consecutive times. Why? Shouldn't arrDigits be automatically initialized to all zeroes?

13th Jul 2019, 6:31 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
2 Answers
+ 3
Seems it depends on sololearn compiler. Needs initialization manually. Good code by the way, easy to understand and follow.
13th Jul 2019, 7:00 PM
Black Winter