I'm trying to practice some c++ stuff and have gotten stuck on something which has been difficult to google or find the answer too.
basically say we have:
char* myarray[] = {"string","hello", "cat"};
how would I got about say getting myarray[1] which is "string" and then traversing through the letter s t r i n g.
I was looking at vectors and wonder if that is the route to take or maybe taking myarray[1] and storing it into another array before iterating through it. What is the best way of doing this
"string"is saved inmyarray[0], notmyarray[1](arrays start at zero in C++). Second, have you tried avectorofstd::stringsinstead? While this is not a real answer to your question, try to accustom yourself to the standard library, which will take some work from you.char* x = "...";. String literals are immutable, and should bechar const*.