Well i'm trying to practice some coding but i stumbled upon this error
The code is this one
secondT is a string variable inside main that is passed as a pointer to be modified inside that example function
error: cannot convert 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' to 'std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}' in assignment
secondT = TChange;
The code is this one
void example(std::string* secondT, int* secondOption){
if(secondOption == 0){
std::string tChange = "ON";
secondOption = 1;
}
else{
std::string tChange = "OFF";
secondOption = 0;
}
secondT = tChange;
}
secondT is a string variable inside main that is passed as a pointer to be modified inside that example function