I have a runtime char** array. Now assuming all allocation is done correctly (which it is), how could I remove an element from this array? I don't want to replace the element I want to remove it completely. Example:
I have:
array[0] = "string1";
array[1] = "string2";
array[2] = "string3";
I want to be able to remove any index - for example let's say index 1. How could I make the array now look like this:
array[0] = "string1";
array[1] = "string3";
The results have effectively removed "string2" and repositioned the contents of the array. Is there a simple way to do this in C with an array w/o having to implement linked list or something.
Thanks,
-bitwise
I have:
array[0] = "string1";
array[1] = "string2";
array[2] = "string3";
I want to be able to remove any index - for example let's say index 1. How could I make the array now look like this:
array[0] = "string1";
array[1] = "string3";
The results have effectively removed "string2" and repositioned the contents of the array. Is there a simple way to do this in C with an array w/o having to implement linked list or something.
Thanks,
-bitwise