Array resize with push?

Get help using Construct 2

Post » Thu Jul 20, 2017 4:35 pm

The documentation day that you can mimic stacks and queues lifo & fifo data structures by using a 1d array and using push and pop, but the documentation also states that array do not dynamically resize.. Does that behave differently with push vs insert?
B
47
S
26
G
2
Posts: 31
Reputation: 4,937

Post » Thu Jul 20, 2017 4:59 pm

The resize comment is only for indexing - you can not index outside of the arrays size and expect it to dynamically resize to make that index valid - it won't. The push/insert... commands do dynamically change the array size, at your command.
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725


Return to How do I....?

Who is online

Users browsing this forum: zsoldiers and 10 guests