Pass a var name as an arg and have function operate on that var

I am trying to sketch out a simple function to add or delete items from arrays. I would like for it to have flexibility to work on any array, therefore the name would be specified by a character string. I am not sure how to do this. Can anyone explain?

If you want to be able to dynamically generate the names of arrays, then operate on them, you'll have a problem with c/c++.
With interpreted languages, like say java script, visual basic script etc. you can do this with a runtime "eval" statement or equivalent. Not, unfortunately in c/c++ though.

What's stopping you from just passing the array in as an argument?

You can have a linked-list of a struct. The struct will have at least 3 fields: name/key, data and a pointer to the next struct in the list.

However, this requires heap manipulation which is not suitable for low memory environment.

mattlogue:
I am trying to sketch out a simple function to add or delete items from arrays. I would like for it to have flexibility to work on any array, therefore the name would be specified by a character string. I am not sure how to do this. Can anyone explain?

It can't be done, not on any array, unless you go upto the level of templates.

You can do for arrays of the same type.

You have to pass the array and the length of array as args.

Names of variables don't exist at runtime, that's purely for compile-time.

If you want to implement an abstract datatype on top of an underlying array you
probably should be thinking of using a class to encapsulate the operations involved,
hiding the implementation within the class.