string to int c++
// Both functions work identically though you'll need to use "#include <string>"
atoi( str.c_str() );
stoi( str );
string to int c++
// Both functions work identically though you'll need to use "#include <string>"
atoi( str.c_str() );
stoi( str );
how to convert string to int in c++
string s = "123";
int n = s.size();
int num = 0;
for(int i = 0 ; i<n;i++)//this what stoi built function do XD
{
num = num*10+(s[i]-'0');
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us