Re: converting string into integer
- From: Jack Klein <jackklein@xxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 21:01:45 -0500
On 17 Jul 2006 17:48:03 -0700, "Andy" <andy660@xxxxxxxxx> wrote in
comp.lang.c:
Please don't trim attribution lines. I've put it back:
On 17 Jul 2006 15:22:23 -0700, "priyanka" <priyankabhar@xxxxxxxxx> wrote in comp.lang.c:
....that's better!
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.
No he can't, not in C.
I think you are a newer to C++. This is a very basic problem. You can
find the answer in many books very easily.
He has a much more basic problem. He either can't distinguish between
C and C++, or he can't distinguish between comp.lang.c and
comp.lang.c++. Until he gets that issue straightened out, I foresee a
world of hurt in his future.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
.
- References:
- converting string into integer
- From: priyanka
- Re: converting string into integer
- From: Andy
- converting string into integer
- Prev by Date: Re: C library for PDF creation?
- Next by Date: Re: Help for designing outlines in c language
- Previous by thread: Re: converting string into integer
- Next by thread: Re: C Programming: A Modern Approach 2nd Edition
- Index(es):