Ok don't think this will be too tough but I haven't used vectors very much. I have a vector declared like this(also an iterator)
I retrieve words from a list and need to compare certain letters from a char variable I have to words that would be stored in my vector. Like if you take input into a char buffer[256] variable the buffer[0] will equal the first letter? I need to do that with items in my vector. Could I initialize a char vector instead and use the same way? Like this:Code:vector<string> wordlist; vector<string>::iterator forward;
But if I do this then each slot in the vector will only be a letter and I can't retrieve whole words. How could I isolate single characters out of a vector? Thanks.Code:vector<char> wordlist; vector<char>::iterator forward; //retrieve and place words into vector for(forward = wordlist.begin(); forward != wordlist.end(); forward++) { if(aChar==forward[0]) { //procede by finishing up } }