I am doing lab for homework, I have the code seemingly correct except when I compile I get an error:
hangman.cpp no matching function for call to `transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unknown type>)'
Headers etc..
transform itself. I can post more parts if this does not show enough.Code:#include <iostream> #include <algorithm> #include <string> using namespace std; using std::transform; int main () { // declare variables string origWord = ""; string letter = ""; char dashReplaced = 'F'; char gameOver = 'F'; int numIncorrect = 0; string guessWord = "-----";
Not sure why it is doing this, this is the only error (there are 2 transforms and both get same error)Code:transform(origWord.begin(), origWord.end(), origWord.begin(), toupper);