So here is the code coming from the array tutorial here in this site
i try to copy paste it to try and see the output
apparently it looks like its broken . But Im not sure about that maybe is there some thing i dont understand
So heres what happen whne i run it
It ouput infinite 7208852
so is it Wronng OR something i need to understand
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
usingnamespace std;
int main()
{
int myarray[3] = {10,20,30};
for (int i=0; i<3; ++i)
++myarray[i];
for (int elem : myarray)
cout << elem << '\n';
}
I meant that your program hasn't been re-compiled since you changed your program.
In IDEs, there is usually a "Clean" or "Rebuild" button (e.g. Visual Studio).
If you don't have this in your environment, just try deleting all your .o (object) files and .exe/.out (executable) files, or whatever it is that is generated when you compile your program.
You can see that your code is fine using a web compiler: http://cpp.sh/5w7dg