| mono (37) | |
|
Question: I have to create a link list of strings and then every single letter has to be separated into a link list for example. if I enter two words like "good" and "bad" those have to be in a link list. I know how to do it, but then I have to make a link list every letter of one of the word for example "good" has to be in a link list g,o,o,d, I need help to separate every letter of the word (string) then I know how to link listed them. thanks for any help.. | |
|
|
|
| pogrady (410) | |
| You know that you can access each element of the string using the [] operator. | |
|
|
|
| mono (37) | |||||
I know that but I have this
when i print
the first print, prints the whole word then it prints the whole word minos the first character for example: if the word is cat when i = 0 it prints "cat" when i = 1 it prints "at" when i = 1 it prints "t" | |||||
|
|
|||||
| pogrady (410) | |
| Looks like its working fine. What is it that you actully want to do? | |
|
|
|
| mono (37) | |
|
I have to permute a link list of a string let say for example if the word is "CAT" I have to enter a string type "CAT" then create a link list with the word "CAT" so every pointer will point to each letter "C" "A" "T" then permute them CAT ATC ACT CTA TCA CTA TAC | |
|
|
|
| pogrady (410) | |
|
It might be easier to use std::vector<char> Then you can use any permutation alogorythm you want since std::vector operator[] allows indexed iteration. Then after every three letters and their group of associated assorted asset states, You could output a space. | |
|
Last edited on
|
|