I'm trying to make a dynamic array which I can add/remove and get values by their index.
I havn't found any other way than using
I tried using these two libraries:
http://playground.arduino.cc/Code/DynamicArrayHelper
http://playground.arduino.cc/Code/StackArray
..but none of them have any method for getting a value by index?
StackArray got a "peek" method:
So..
How do I create a dynamic array? (which I can get values by their index)
Thank you in advance!
I havn't found any other way than using
int myArray[8];
..to make an array. But this way the array is not dynamic, it has a constant size.I tried using these two libraries:
http://playground.arduino.cc/Code/DynamicArrayHelper
http://playground.arduino.cc/Code/StackArray
..but none of them have any method for getting a value by index?
StackArray got a "peek" method:
T peek ()
Get an item with data type "T" from the stack.
..but it has no parameters for the index.Get an item with data type "T" from the stack.
So..
How do I create a dynamic array? (which I can get values by their index)
Thank you in advance!