Well exactly. I didn't put a[i] in my code, I just put a.
Even I know that, I was just clarifying Mr. Andors point.
I don't think I can use isdigit because I'm not supposed to decremenet 0.
What does this mean ?
If you encounter 0 in your string, how would you handle it.. surely you cant put -1 ?
And what if my task was to, say, multiply every digit found by two? How would I do that?
But suppose your digit is greater than 4.. then how do you propose to do it since it would then imply making spaces for new digits ?
State your program requirements in more detail.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
Offline 8,872 posts
since Jun 2006