1. ## string question

hi there,

i am trying to get all different possibilites of my string but i get lost when get deep in it.

assume
char *s = "dummy"
but there may be substitutions for specifici characters.
e.g. (u-f) (u-z) (y-w)

so all possible strings are:
dummy dummw
dfmmy dfmmw
dzmmy dzmmw

i thinik algorithm is a recursion.
any suggestions?

2. Use strchr().

3. how? i could not get the point

4. > char *s = "dummy"
Except you can't modify such strings, so you would at least need to start with
char s[] = "dummy";

> how? i could not get the point
strchr() returns a pointer to a char, if it finds the char, or NULL if not.
So
char *p = strchr(s,'m');
Would result in p pointing to the first 'm'

You can then do something like
*p = 'z';

5. To use strchr() to replace all occurences of a character, you can use a loop:
Code:
```char *p;
while(p = strchr(s, 'a')) *p = 'b';```

6. thanks i see that but there may be more than one substitution so i need a combination or st. like that.

7. Well what would be quite helpful is for you to make your best attempt at the code. Then, if it is not working the way you want, post it here and we can advise you as necessary.

~/