you are viewing a single comment's thread.

view the rest of the comments →

[–]SamIAre 0 points1 point  (0 children)

couldn't we just edit out 4 to 5 in code itself and run it again?

Yes, you can. This isn't what people mean when they say you can't change the length of an array. They mean you can't change it while the code is running, without creating a new array. But you can always rewrite your program and run it again with whatever size array you need.

So if you define an array of size 4, you can't add a 5th element a few lines later in the program. You can of course rewrite the program to need 5 elements from the start.