one good method is to store all the names in a vector , that is a array that can store any object type , first you have to include <vector> library
the declaration that you are looking for is as follows (assuming that you are using namespace std)
|
vector<const char*> myNames;
|
this creates a resizable vector that stores only const char*
there are more initialisers list for vectors like vector<const char*> myNames(10, "names"); which initialises 10 identically elements which all hold "names"
for more information google is your friend
to add more elements to the vector use myNames.push_back("some string"); , this adds some string to the back of the vector
to pop elements you use myNames.pop_back();
to access elements you use subscription operator [] just like with arrays
for example cout << myNames[3]; outputs the 4th element of the vector