std::string to pointer to const char*
I'v got a function that looks like this..
in my main program i'm trying to call this funtion. But then copy it to another STD::STRING so that i then can copy it to a const char*
If your wondering what the entire funtion looks like here it is...
Code:
std::string GetString(std::string key)
Code:
std::string pet = GetString("dog");
const char * newpet = pet.c_str();
Code:
std::string GetString(std::string key)
{
//Check to see if anything got parsed?
if (i == 0)
{
return "";
}
for (int x = 0; x <= i; x++)
{
if (key == iniItem[x]->key)
{
return iniItem[x]->value;
}
}
return "";
}


