I have a char** that I frequently need to insert into or perform a lookup. It is very tedious to realloc(), malloc() the array and insert strings.
Is there any standard way that I can add strings to or do lookups in a char**? I guess I’m looking for something like string, but using char**‘s instead.
If you’re frequently inserting into this structure, you shouldn’t be using a
char**at all; an array isn’t a suitable data structure for these kinds of operations. Consider astd::vector<string>or something similar if possible.