Just checking ... new arrays are zeroed right?
BlitzMax Forums/BlitzMax Beginners Area/Just checking ... new arrays are zeroed right?
| ||
well the title says it all, if I declare myarray[10], the contents will always be 0 in each array slot won't they? I ask because in Delphi this is not the case (or maybe I'm thinking about when you declare a space of memory, it doesn't clean it out for you). |
| ||
yes |
| ||
0 for numerics, "" for strings and null for objects to be more specific. |
| ||
lovely, thought so, thanks. |
| ||
hahah, yep Grey Myarray:int[10] lol |
| ||
I always get paranoid about things like this, so tend to set to 0 with a for loop. |
| ||
Guys, it only takes like 30 seconds to make a test program and put your mind to ease. :) |
| ||
Yupp but that does not say anything. Just because something is like that once it does not mean that it is always like that or that other systems behave the same. "proofing by testing" is nonsense :-) |
| ||
Guys, it only takes like 30 seconds to make a test program and put your mind to ease. :) Ahh, but for example that flip thing that "somethimes" gives you the last screen, but not always. Thats just the sort of thing where testing is brill |
| ||
Guys, it only takes like 30 seconds to make a test program and put your mind to ease. :) correct however, In Delphi if you made a test app and looked at the memory, depending on what it was used for before it may all be zeros. Run the test later in the day and it could be filled with junk. The Delphi manuals state for sure that it is already zeroed so I thought I'd ask on the forums as a quick way to hopefully get a definitive answer. |
| ||
You got a definitive answer - but it's not adviseable to do it. ;-) |