Re: atoi query
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Fri, 20 Apr 2007 08:21:51 -0400
ptq2238@xxxxxxxxx wrote:
.... snip ...
strltol seems to work when I enter numbers first then chars but
not the other way around.
Now I'm confused in how I can use strtol on the 2nd example, ie
qwe123 and extract the numeric portion, which was based on my
original intentions of getting a character then a numeric from a
string. Have I misunderstood the strtol function ?
Yes. strtol starts at the beginning. It can't extract a number
from chars, so it fails. It will skip leading blanks only.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- atoi query
- From: ptq2238
- Re: atoi query
- From: Default User
- Re: atoi query
- From: ptq2238
- atoi query
- Prev by Date: Re: Test Your C Skills - Errors
- Next by Date: Re: atoi query
- Previous by thread: Re: atoi query
- Next by thread: Re: atoi query
- Index(es):
Relevant Pages
|