hey,I'm in my first programming class and i cant figure out how to use atoi to change from a string to an integer.
please let me know what i'm doing wrong!!!!
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
int num;
string digits= "153";
num = atoi(digits.c_str());
cout<<num<<endl;
}