So basically i need to replace the first digit of the 'temperature', if its '1', to either a '2' or a '0'. i haven't gotten to the zero part of the code yet i am just stuck on the first replace function. for what ever reason i keep getting an error stating that theres "no matching member function for call to 'replace'". not sure what i could be doing wrong. I have changed the user inputted int "temp" to a string "sTemp" and am able to determine if the first character of the string is in fact a 1 or not. But again getting error on replace.
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
int temP;
string sTemp;
stringstream ss;
cout << "Enter the temperature desired: " << endl;
cin >> temP;
ss << temP;
ss >> sTemp;
if (sTemp[0] == '1')
sTemp.replace(0, 1, '2');
return 0;
}