Hello I am using c++ for this assignment.
If I have a string such as "P10" and I want to store the number 10 into an integer disregarding the P, how would I do that?
Hello I am using c++ for this assignment.
If I have a string such as "P10" and I want to store the number 10 into an integer disregarding the P, how would I do that?
Assuming you only want to remove the first character from your string then
#include <string>
std::string str = "P10";
int i = std::stoi(str.substr(1));