int array [5] = {5}; ? what the element in the array of the following code ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

int array [5] = {5}; ? what the element in the array of the following code ?

15th Apr 2019, 11:53 PM
Fernando Fergan Yugan
Fernando Fergan Yugan - avatar
2 Answers
0
this kind of initialization is bad if I would say, because when you decided to access the arrays which you do not assign, then you start getting problem, I read a programming tips sometimes ago it says "initialize your array like you initialize you variables too', it did not make sense at first until I discover it's true, to your question from 1-4 should be which am not sure about because it could vary 0 and 0=5
16th Apr 2019, 6:48 AM
✳AsterisK✳
✳AsterisK✳ - avatar
0
22nd May 2020, 5:33 AM
Šhîvã Rock
Šhîvã Rock - avatar