Jump to content

Allocating space in memory for each object in array


McDeKi

Recommended Posts

Hello.

I've got array with items ( inventory ).

The problem is when I have two elements with the same values but with different indexes.

  
--//Pseudo code 
Inventory[1][6] = "Apple" 
Inventory[5][4] = "Apple" 
  

lua allocates those elements in the same place in memory, inventory[1][6] = "Apple" and Inventory[5][4] = "Apple" has the same space (table: 21D2E2A8)

First item:

KkyV0CG.png

Second item:

C4sGUhe.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...