Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, degenerate_762, ozgur), 1,311 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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