Hi,
I am currently working on a small tokenizer template function which also casts the tokens to different objects. this works really nice aslong as all the strucs I cast to have the same number of items. what I would like to do know is to make the function cast to structs with any number of items. The bottleneck of the function for me right now is this: When it was a fixed number(in this case three) of items I did this:
mystruct holder = {items[i], items[i+1], items[i+2]};
Now my idea to be able to cast to structs with different items was to put all items into one array (all the struct items will be of the same type) and simply initialize it like this:
float values[numItems];
for(int j=0; j<numItems; j++) values[j] = items[i+j]
mystruct holder = {values};
But unfortunatelly you cant initialize a struct like this. Does anybody have an idea about how to achieve this? Thanks!