how to fill vector with char* strings
hello all
im trying to add char* text into std::vector
but im keep getting compilations errors , basally i need to keep dynamically container that holds char* strings
Code:
static std::vector<char*> v;
....
....
char *name = getName();
setVector(name);
//then i have the inline function that handle the vector operation
inline void setVector(const char* c){
myClass::v.push_back(c);
}
the error im keep getting is :
error C2664: 'push_back' : cannot convert parameter 1 from 'const char *' to 'const char &'
Reason: cannot convert from 'const char *' to 'const char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
what im doing wrong here ?
is it the best way to keep char* text in container ?