Re: a question abou "atoi"
- From: William Pursell <bill.pursell@xxxxxxxxx>
- Date: Fri, 31 Oct 2008 00:42:17 -0700 (PDT)
On 31 Oct, 02:05, user923005 <dcor...@xxxxxxxxx> wrote:
for (index = 0; index < strlen(string); index++) {
substring[0] = string[index];
a = atoi(substring);
printf("%d\n", a);
}
Don't put strlen as a loop condition. Try:
len = strlen( string );
for( i = 0 ; i < len; i++ )
....
.
- Follow-Ups:
- Re: a question abou "atoi"
- From: Richard Heathfield
- Re: a question abou "atoi"
- References:
- Re: a question abou "atoi"
- From: user923005
- Re: a question abou "atoi"
- Prev by Date: Re: srand
- Next by Date: Re: Where did my console output go?
- Previous by thread: Re: a question abou "atoi"
- Next by thread: Re: a question abou "atoi"
- Index(es):