Hey everyone this is a portion of a program that i am working on. I used the find_state function earlier in my program to traverse the linked list. I was going to try and use it again to print out all the cities of a particular user entered state. Although, when i try to pass over pickState to find_state it can not be changed to a char*. Is there any way to pass over pickState to that function or should i just write a new function?
I don't see why you're using char* at all, it's clumsy and not necessary. For comparisons with a std::string use operator==(), and for conversion (when needed) use c_str():
if(pickState == find_state(pickState.c_str(), head)) // assuming PtrType is a typedef for char*
Passing a char array using string::data() where a C string is expected sounds crash bound. string::data() returns a char array without a null terminator. Functions that deal with C strings use the null terminator to figure out when to stop reading or writing.