0
This codedont work
i practicing code and the thing out put 0? and skiped alot of numbers i need 2 know, also i dont understand for loops can some explain to be in other words txx. https://code.sololearn.com/cIJH6EYX57dK/?ref=app https://code.sololearn.com/cIJH6EYX57dK/?ref=app
2 odpowiedzi
+ 1
Check your code again. You declared an array of size 8. So the for loop should run 8 times (not 70 times) to initialize all the values in the array, like this
for(int x=0; x<8; x++){
myArr[x] = 42;
cout<<x<<" : "<<myArr[x]<<endl;
}
You are using your for loop from 0 to 70, therefore in the output, after 7 subscript, system is printing just garbage!
0
ooohhh ok thanks