string

how can i use atoi function in c++??

i dont understand what wrote there...plz provide me a c++ code that have use atoi function
closed account (2LzbRXSz)
http://www.cplusplus.com/reference/cstdlib/atoi/ gives an example, but here's one that I came up with myself...

1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;

int main()
{
    string str = "35";
    int num = atoi(str.c_str());
}
Topic archived. No new replies allowed.