converting string into integer
- From: "priyanka" <priyankabhar@xxxxxxxxx>
- Date: 17 Jul 2006 15:22:23 -0700
Hi there,
I want to convert a String into integer.
I get the string froma file using :
string argNum;
getline(inputStream,argNum);
I now need to convert argNum into integer.
I tried to use
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*)'
And for the getline function, the argNum must be a string variable.
Can anyone please tell me how to convert argNum into integer ?
Thank you in advance,
priya
.
- Follow-Ups:
- Re: converting string into integer
- From: Andy
- Re: converting string into integer
- From: spibou
- Re: converting string into integer
- From: Peter Nilsson
- Re: converting string into integer
- Prev by Date: Re: error when rename pointer names
- Next by Date: Re: converting string into integer
- Previous by thread: Re: OT: Re: automated coding standard validation?
- Next by thread: Re: converting string into integer
- Index(es):
Relevant Pages
|