sorry i left out the fact that i am looking to create an array of my class!
i am comming into arduino from c#.
i defiantly do not need my array inside the class to be dynamic. the way that i understand the term "dynamic" is that it is adjustable. i want to set a fixed size on declaration and was hoping there would be a way in c++ to ask for the set reservation of memory at the top of my sketch.
another option i was considering was to give each class a reference to a jagged array.
something like this:
byte jagged [][]= {{1,2,3},{1,2,3,4},{1,2,3,4,5}};
but c++ is not undersanding a jagged array either.
so to accomplish my task i see no other option but something messy and ugly like this:
class myclass {
public:
static byte store [11]{1,2,3,1,2,3,4,1,2,3,4,5};
static byte returnarray [5];//highest number declaired
byte myindex;
byte mylength;
void fill (){
byte i = mylength;
while(i>0){i--;
returnarray[i]=store[i+myindex]; } }
myclass(byte idx, byte len){
myindex = idx; mylength = len;
// will need to grab from the return array and use the classes length variable
}
};
for my purposes i will need to loop through many instances of the class and the array size can vary alot so i dont want to reserve memory for the max amount that each class would have.