Have you considered storing a char** instead of a void**? By using the latter, you presumably want some kind of generic vector, but then you need to change your vector interface to account for the size of objects that it stores, and it becomes even more complicated for strings because you cannot assume that just because each void* points to a char, that that char is necessarily the first char in a string. If you just went with a char** and documented this as being a vector of strings, problem solved.

Originally Posted by Bjarne Stroustrup (2000-10-14)

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.

Have you considered storing a char** instead of a void**? By using the latter, you presumably want some kind of generic vector, but then you need to change your vector interface to account for the size of objects that it stores, and it becomes even more complicated for strings because you cannot assume that just because each void* points to a char, that that char is necessarily the first char in a string. If you just went with a char** and documented this as being a vector of strings, problem solved.

This is actually something that I thought about I want to make a generic vector but with the strings it complicates things. At this point, it is a vector of string more than generic.