It's perfectly possible to use an array of strings, as you have done. Since you haven't posted your code, there's no way we can tell what's wrong with it, but my guess would be that it's a namespace qualification issue. If so, you need to do one of the following:
(1) Use the complete, namespace-qualified class name:
|
std::string name[100]; //to store 100 name examples
|
(2) Bring
std::string into your translation unit, by putting
somewhere near the top of your .cpp file
(3) Bring the entire
std namespace into your translation unit, by putting
somewhere near the top of your .cpp file.
As cPlusN00b says, you're better off using vectors rather than arrays. The header file for the
std::vector class will almost certainly be in the same place as the header file for
std::string.