For a program that I write based on specifications, a variable is passed to the function as a string. I need to set this string to a char variable in order to set another variable. How can i do this?
This is it in the header file:
void setDisplayChar(char displayCharToSet);
this is the function that installs it:
void Entity::setElementData(string elementName, string value){
if(elementName == "name"){
setName(value);
}
else if(elementName == "displayChar"){
setDisplayChar('x');
}
else if(elementName == "property"){
this->properties.push_back(value);
}
}
Thanks for the help in the advanced version!
source
share