Re: converting string into integer
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Tue, 18 Jul 2006 01:38:14 GMT
"Andy" <andy660@xxxxxxxxx> writes:
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.
The original question was posted by "priyanka" <priyankabhar@xxxxxxxxx>.
Please don't snip attribution lines.
If your answer involves C++, please don't post it here. comp.lang.c++
is down the hall, third door on the left, just past the water cooler.
We discuss C here, and we can't check the accuracy of any C++
information.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- converting string into integer
- From: priyanka
- Re: converting string into integer
- From: Andy
- converting string into integer
- Prev by Date: Re: convert int to string without using standard library (stdio.h)
- 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):
Relevant Pages
|