Re: converting string into integer
- From: "Andy" <andy660@xxxxxxxxx>
- Date: 17 Jul 2006 17:48:03 -0700
int a = atoi(argNum);
But I got errot message :error: cannot convert `std::string' to `const
char*' for argument `1' to `int atoi(const char*)'
You can use argNum.c_str() to solve this problem.
I think you are a newer to C++. This is a very basic problem. You can
find the answer in many books very easily.
.
- Follow-Ups:
- Re: converting string into integer
- From: Jack Klein
- Re: converting string into integer
- From: Keith Thompson
- Re: converting string into integer
- References:
- converting string into integer
- From: priyanka
- converting string into integer
- Prev by Date: Re: command line arguements with spaces in them
- Next by Date: Re: How to write a small graceful gcd function?
- Previous by thread: Re: converting string into integer
- Next by thread: Re: converting string into integer
- Index(es):