In C I want a function like this:
bool RemoveFirstIndex(char* inArray[])
which goes in and takes out the very first element in that array.
e.g.
inArray = "Hello\o", "How\o", "Are\o"
RemoveFirstIndex(inArray)
inArray = "How\o", "Are\o"
Not sure how to go about it.
I get the idea that I would have to create a new array of inSize – 1, and just fill it with everything except index 0.
But if I do that, does the function need to return a new char*[]? Isnt that a bit wasteful?
Thank you.
Why remove the first element or create a new array?
Just can just increment your pointer so it points to the next item in the array.
newArrayis valid as long asinArrayis.