HELP!! how do you use atoi?
I'm trying to figure out how to use the atoi function I have wrote and understand this so far:
#include
#include
#include
using namespace std;
int main()
{
int x;
string str="34";
x=atoi(str);
cout<
CPPRULZ
Junior Poster in Training
91 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
Thank you so much-it works now but I still don't get why you need the .c_str()-does it make it refer to str as a constant string?
CPPRULZ
Junior Poster in Training
91 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
CPPRULZ
Junior Poster in Training
91 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0