Link to home
Start Free TrialLog in
Avatar of jamie_lynn
jamie_lynn

asked on

Character iterator

Hi,
I'm trying to iterate each character from a string.
What is the most efficient and best way?

i.e.
char *s = "abcdefg";
I want to loop that pops the first character.
So get 'a' then 'b', then  'c', 'd', etc.

Thanks
Jamie
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamie_lynn
jamie_lynn

ASKER

Thanks Sunnycoder!
Hi jamie_lynn,

Just a quick extra.

This works too, you choose:

for ( ;*s; s++ ) {
}


Paul