Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
a question about arrays #368201
04/22/11 16:55
04/22/11 16:55
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline OP
Expert
NITRO777  Offline OP
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
Hello,
I was just experimenting with arrays and noticed that after ths code:
Code:
var array_test[2][9];
array_test[1][1]= 1;
array_test[2][10]=4;



The engine still works with fine with this,but I would expect an error, isn't the array out-of-bounds at [2][10]? Why will it still accept data at that location?


Last edited by NITRO777; 04/22/11 17:06. Reason: spelling
Re: a question about arrays [Re: NITRO777] #368203
04/22/11 17:07
04/22/11 17:07
Joined: Feb 2011
Posts: 135
Myrkling Offline
Member
Myrkling  Offline
Member

Joined: Feb 2011
Posts: 135
Lite-C doesn't have bounds checking, so by writing to invalid indices adjacent memory is overwritten.
This can cause random crashes (depending on what is overwritten).

Re: a question about arrays [Re: Myrkling] #368204
04/22/11 17:17
04/22/11 17:17
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline OP
Expert
NITRO777  Offline OP
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
thanks


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1