4 Replies - 877 Views - Last Post: 29 June 2014 - 05:12 AM Rate Topic: -----

#1 prvn20  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-June 14

Hangman (Country Guessing Game)

Posted 28 June 2014 - 09:48 PM

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
#include <istream>
using namespace std;
const int MAX_TRIES=5;
int letterFill (char, string, string&);
int main ()
{
string name;
char letter;
int num_of_wrong_guesses=0;
string word;
// welcome the user
cout << "\n\nWelcome to hangman!! Guess a country that comes into your mind.";
// Ask user for for Easy, Average, Hard
string level;
cout <<"\nChoose a LEVEL(E - Easy, A - Average, H - Hard):" << endl;
cin >> level >> endl;
// compare level 
if(level == "Easy")
{
 //put all the string inside the array here
 string easy[] = {"india","japan","nepal","china"};
 string word;
 
 srand(time(NULL));
 
 int n=rand()% 4;
 
 word=easy[n];
 
 //call the function here for guessing game
 // Initialize the secret word with the * character.
string unknown(word.length(),'*');
cout << "\n\nEach letter is represented by an asterisk.";
cout << "\n\nYou have to type only one letter in one try.";
cout << "\n\nYou have " << MAX_TRIES << " tries to try and guess the country.";
cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
// Loop until the guesses are used up
while (num_of_wrong_guesses < MAX_TRIES)
{
cout << "\n\n" << unknown;
cout << "\n\nGuess a letter: ";
cin >> letter;
// Fill secret word with letter if the guess is correct,
// otherwise increment the number of wrong guesses.
if (letterFill(letter, word, unknown)==0)
{
cout << endl << "Whoops! That letter isn't in there!" << endl;
num_of_wrong_guesses++;
}
else
{
cout << endl << "You found a letter! Isn't that exciting?" << endl;
}
// Tell user how many guesses has left.
cout << "You have " << MAX_TRIES - num_of_wrong_guesses;
cout << " guesses left." << endl;
// Check if user guessed the word.
if (word==unknown)
{
cout << word << endl;
cout << "Yeah! You got it!";
break;
}
}
if(num_of_wrong_guesses == MAX_TRIES)
{
cout << "\nSorry, you lose...you've been hanged." << endl;
cout << "The word was : " << word << endl;
}
cin.ignore();
cin.get();
return 0;
}
/* Take a one character guess and the secret word, and fill in the
unfinished guessword. Returns number of characters matched.
Also, returns zero if the character is already guessed. */
int letterFill (char guess, string secretword, string &guessword)
{
int i;
int matches=0;
int len=secretword.length();
for (i = 0; i< len; i++)
{
// Did we already match this letter in a previous guess?
if (guess == guessword[i])
return 0;
// Is the guess in the secret word?
if (guess == secretword[i])
{
guessword[i] = guess;
matches++;
}
}
return matches;
}
else if (level == "Average")
{
//put all the string inside the array here
 string average[] = {"madagascar","azerbaijan","kyrgyzstan"};
 
srand(time(NULL));
 int n=rand()% 3;
 
 word=average[n];	
  
 //call the function here for guessing game
  // Initialize the secret word with the * character.
string unknown(word.length(),'*');
cout << "\n\nEach letter is represented by an asterisk.";
cout << "\n\nYou have to type only one letter in one try.";
cout << "\n\nYou have " << MAX_TRIES << " tries to try and guess the country.";
cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
// Loop until the guesses are used up
while (num_of_wrong_guesses < MAX_TRIES)
{
cout << "\n\n" << unknown;
cout << "\n\nGuess a letter: ";
cin >> letter;
// Fill secret word with letter if the guess is correct,
// otherwise increment the number of wrong guesses.
if (letterFill(letter, word, unknown)==0)
{
cout << endl << "Whoops! That letter isn't in there!" << endl;
num_of_wrong_guesses++;
}
else
{
cout << endl << "You found a letter! Isn't that exciting?" << endl;
}
// Tell user how many guesses has left.
cout << "You have " << MAX_TRIES - num_of_wrong_guesses;
cout << " guesses left." << endl;
// Check if user guessed the word.
if (word==unknown)
{
cout << word << endl;
cout << "Yeah! You got it!";
break;
}
}
if(num_of_wrong_guesses == MAX_TRIES)
{
cout << "\nSorry, you lose...you've been hanged." << endl;
cout << "The word was : " << word << endl;
}
cin.ignore();
cin.get();
return 0;
}
/* Take a one character guess and the secret word, and fill in the
unfinished guessword. Returns number of characters matched.
Also, returns zero if the character is already guessed. */
int letterFill (char guess, string secretword, string &guessword)
{
int i;
int matches=0;
int len=secretword.length();
for (i = 0; i< len; i++)
{
// Did we already match this letter in a previous guess?
if (guess == guessword[i])
return 0;
// Is the guess in the secret word?
if (guess == secretword[i])
{
guessword[i] = guess;
matches++;
}
}
return matches;
}
else if(level == "Hard")
{
 //put all the string inside the array here
 string hard[] = {"turkmenistan","french guiana","new caledonia"};
 
srand(time(NULL));
 
 int n=rand()% 3;
 
 word=hard[n];
  
 //call the function here for guessing game
  // Initialize the secret word with the * character.
string unknown(word.length(),'*');
cout << "\n\nEach letter is represented by an asterisk.";
cout << "\n\nYou have to type only one letter in one try.";
cout << "\n\nYou have " << MAX_TRIES << " tries to try and guess the country.";
cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
// Loop until the guesses are used up
while (num_of_wrong_guesses < MAX_TRIES)
{
cout << "\n\n" << unknown;
cout << "\n\nGuess a letter: ";
cin >> letter;
// Fill secret word with letter if the guess is correct,
// otherwise increment the number of wrong guesses.
if (letterFill(letter, word, unknown)==0)
{
cout << endl << "Whoops! That letter isn't in there!" << endl;
num_of_wrong_guesses++;
}
else
{
cout << endl << "You found a letter! Isn't that exciting?" << endl;
}
// Tell user how many guesses has left.
cout << "You have " << MAX_TRIES - num_of_wrong_guesses;
cout << " guesses left." << endl;
// Check if user guessed the word.
if (word==unknown)
{
cout << word << endl;
cout << "Yeah! You got it!";
break;
}
}
if(num_of_wrong_guesses == MAX_TRIES)
{
cout << "\nSorry, you lose...you've been hanged." << endl;
cout << "The word was : " << word << endl;
}
cin.ignore();
cin.get();
return 0;
}
/* Take a one character guess and the secret word, and fill in the
unfinished guessword. Returns number of characters matched.
Also, returns zero if the character is already guessed. */
int letterFill (char guess, string secretword, string &guessword)
{
int i;
int matches=0;
int len=secretword.length();
for (i = 0; i< len; i++)
{
// Did we already match this letter in a previous guess?
if (guess == guessword[i])
return 0;
// Is the guess in the secret word?
if (guess == secretword[i])
{
guessword[i] = guess;
matches++;
}
}
return matches;
}




I'm getting 80 errors and don't know how to fix it. Please help me with this I'm just a beginner. Thanks!! :)

Is This A Good Question/Topic? 0
  • +

Replies To: Hangman (Country Guessing Game)

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10767
  • View blog
  • Posts: 40,093
  • Joined: 27-December 08

Re: Hangman (Country Guessing Game)

Posted 28 June 2014 - 09:49 PM

1) Please properly indent your code. Not to be rude, but it's really a mess to read.

2) Please post your errors exactly as they appear.
Was This Post Helpful? 0
  • +
  • -

#3 prvn20  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 28-June 14

Re: Hangman (Country Guessing Game)

Posted 28 June 2014 - 10:33 PM

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
#include <istream>
using namespace std;
const int MAX_TRIES=5;
int letterFill (char, string, string&);
int main ()
{
	string name;
	char letter;
	int num_of_wrong_guesses=0;
	string word;
	// welcome the user
	cout << "\n\nWelcome to hangman!! Guess a country that comes into your mind.";
	// Ask user for for Easy, Average, Hard
	string level;
	cout <<"\nChoose a LEVEL(E - Easy, A - Average, H - Hard):" << endl;
	cin >> level >> endl;
	// compare level 
	if(level == "Easy")
	{
 		//put all the string inside the array here
 		string easy[] = {"india","japan","nepal","china"};
 		string word;
 
 		srand(time(NULL));
 
 		int n=rand()% 4;
 
		word=easy[n];
 
 		//call the function here for guessing game
 		// Initialize the secret word with the * character.
		string unknown(word.length(),'*');
		cout << "\n\nEach letter is represented by an asterisk.";
		cout << "\n\nYou have to type only one letter in one try.";
		cout << "\n\nYou have " << MAX_TRIES << " tries to try and guess the country.";
		cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
		// Loop until the guesses are used up
		while (num_of_wrong_guesses < MAX_TRIES)
		{
			cout << "\n\n" << unknown;
			cout << "\n\nGuess a letter: ";
			cin >> letter;
			// Fill secret word with letter if the guess is correct,
			// otherwise increment the number of wrong guesses.
			if (letterFill(letter, word, unknown)==0)
			{	
				cout << endl << "Whoops! That letter isn't in there!" << endl;
				num_of_wrong_guesses++;
			}	
			else
			{
				cout << endl << "You found a letter! Isn't that exciting?" << endl;
			}
				// Tell user how many guesses has left.
				cout << "You have " << MAX_TRIES - num_of_wrong_guesses;
				cout << " guesses left." << endl;
				// Check if user guessed the word.
			if (word==unknown)
			{
				cout << word << endl;
				cout << "Yeah! You got it!";
				break;
			}
		}		
		if(num_of_wrong_guesses == MAX_TRIES)
		{
			cout << "\nSorry, you lose...you've been hanged." << endl;
			cout << "The word was : " << word << endl;
		}
		cin.ignore();
		cin.get();
		return 0;
	}
	/* Take a one character guess and the secret word, and fill in the
	unfinished guessword. Returns number of characters matched.
	Also, returns zero if the character is already guessed. */
	int letterFill (char guess, string secretword, string &guessword)
	{
		int i;
		int matches=0;
		int len=secretword.length();
		for (i = 0; i< len; i++)
		{
			// Did we already match this letter in a previous guess?
			if (guess == guessword[i])
			return 0;
			// Is the guess in the secret word?
			if (guess == secretword[i])
			{
				guessword[i] = guess;
				matches++;
			}
		}
		return matches;
	}
	else if (level == "Average")
	{
		//put all the string inside the array here
 		string average[] = {"madagascar","azerbaijan","kyrgyzstan"};
 
		srand(time(NULL));
 		int n=rand()% 3;
 
 		word=average[n];	
  
 		//call the function here for guessing game
		// Initialize the secret word with the * character.
		string unknown(word.length(),'*');
		cout << "\n\nEach letter is represented by an asterisk.";
		cout << "\n\nYou have to type only one letter in one try.";
		cout << "\n\nYou have " << MAX_TRIES << " tries to try and guess the country.";
		cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
		// Loop until the guesses are used up
		while (num_of_wrong_guesses < MAX_TRIES)
		{
			cout << "\n\n" << unknown;
			cout << "\n\nGuess a letter: ";
			cin >> letter;
			// Fill secret word with letter if the guess is correct,
			// otherwise increment the number of wrong guesses.
			if (letterFill(letter, word, unknown)==0)
			{	
				cout << endl << "Whoops! That letter isn't in there!" << endl;
				num_of_wrong_guesses++;
			}	
			else
			{
				cout << endl << "You found a letter! Isn't that exciting?" << endl;
			}
				// Tell user how many guesses has left.
				cout << "You have " << MAX_TRIES - num_of_wrong_guesses;
				cout << " guesses left." << endl;
				// Check if user guessed the word.
			if (word==unknown)
			{
				cout << word << endl;
				cout << "Yeah! You got it!";
				break;
			}
		}		
		if(num_of_wrong_guesses == MAX_TRIES)
		{
			cout << "\nSorry, you lose...you've been hanged." << endl;
			cout << "The word was : " << word << endl;
		}
		cin.ignore();
		cin.get();
		return 0;
	}
	/* Take a one character guess and the secret word, and fill in the
	unfinished guessword. Returns number of characters matched.
	Also, returns zero if the character is already guessed. */
	int letterFill (char guess, string secretword, string &guessword)
	{
		int i;
		int matches=0;
		int len=secretword.length();
		for (i = 0; i< len; i++)
		{
			// Did we already match this letter in a previous guess?
			if (guess == guessword[i])
			return 0;
			// Is the guess in the secret word?
			if (guess == secretword[i])
			{
				guessword[i] = guess;
				matches++;
			}
		}
		return matches;
	}
	else if(level == "Hard")
	{
 		//put all the string inside the array here
 		string hard[] = {"turkmenistan","french guiana","new caledonia"};
 
		srand(time(NULL));
 
 		int n=rand()% 3;
 
 		word=hard[n];
  
 		//call the function here for guessing game
 		// Initialize the secret word with the * character.
		string unknown(word.length(),'*');
		cout << "\n\nEach letter is represented by an asterisk.";
		cout << "\n\nYou have to type only one letter in one try.";
		cout << "\n\nYou have " << MAX_TRIES << " tries to try and guess the country.";
		cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
		// Loop until the guesses are used up
		while (num_of_wrong_guesses < MAX_TRIES)
		{
			cout << "\n\n" << unknown;
			cout << "\n\nGuess a letter: ";
			cin >> letter;
			// Fill secret word with letter if the guess is correct,
			// otherwise increment the number of wrong guesses.
			if (letterFill(letter, word, unknown)==0)
			{	
				cout << endl << "Whoops! That letter isn't in there!" << endl;
				num_of_wrong_guesses++;
			}	
			else
			{
				cout << endl << "You found a letter! Isn't that exciting?" << endl;
			}
				// Tell user how many guesses has left.
				cout << "You have " << MAX_TRIES - num_of_wrong_guesses;
				cout << " guesses left." << endl;
				// Check if user guessed the word.
			if (word==unknown)
			{
				cout << word << endl;
				cout << "Yeah! You got it!";
				break;
			}
		}		
		if(num_of_wrong_guesses == MAX_TRIES)
		{
			cout << "\nSorry, you lose...you've been hanged." << endl;
			cout << "The word was : " << word << endl;
		}
		cin.ignore();
		cin.get();
		return 0;
	}
	/* Take a one character guess and the secret word, and fill in the
	unfinished guessword. Returns number of characters matched.
	Also, returns zero if the character is already guessed. */
	int letterFill (char guess, string secretword, string &guessword)
	{
		int i;
		int matches=0;
		int len=secretword.length();
		for (i = 0; i< len; i++)
		{
			// Did we already match this letter in a previous guess?
			if (guess == guessword[i])
			return 0;
			// Is the guess in the secret word?
			if (guess == secretword[i])
			{
				guessword[i] = guess;
				matches++;
			}
		}
		return matches;

	}
}




**I hope it's readable now.

The errors it's giving is as follows:

C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp In function 'int main()':
20 15 [Error] no match for 'operator>>' (operand types are 'std::basic_istream<char>' and '<unresolved overloaded function type>')
20 15 [Note] candidates are:
40 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
120 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
120 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&) {aka std::basic_istream<char>& (*)(std::basic_istream<char>&)}'
124 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__ios_type& (*)(std::basic_istream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]
124 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'
131 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
131 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
168 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
168 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
172 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]
172 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
175 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
175 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
179 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]
179 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
182 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
182 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
186 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
186 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
190 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
190 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
195 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
195 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
199 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
214 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
214 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
218 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
218 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
222 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
222 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
235 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]
235 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
259 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]
259 7 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}'
53 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\string In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\string
40 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\locale_classes.h from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\locale_classes.h
41 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\ios_base.h from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\ios_base.h
42 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\ios from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\ios
38 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\ostream from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\ostream
39 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
996 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\basic_string.tcc [Note] template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)
996 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\basic_string.tcc [Note] template argument deduction/substitution failed:
20 18 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp [Note] couldn't deduce template parameter '_Alloc'
40 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
770 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] std::basic_istream<_CharT2, _Traits2>& std::operator>>(std::basic_istream<_CharT2, _Traits2>&, _CharT2*) [with _CharT2 = char; _Traits2 = std::char_traits<char>; _CharT = char; _Traits = std::char_traits<char>]
770 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] no known conversion for argument 2 from '<unresolved overloaded function type>' to 'char*'
879 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream
40 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
923 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\istream.tcc [Note] std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&) [with _CharT = char; _Traits = std::char_traits<char>]
923 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\bits\istream.tcc [Note] no known conversion for argument 2 from '<unresolved overloaded function type>' to 'char&'
40 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
727 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)
727 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template argument deduction/substitution failed:
20 18 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp [Note] cannot convert 'std::endl' (type '<unresolved overloaded function type>') to type 'unsigned char&'
40 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
732 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)
732 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template argument deduction/substitution failed:
20 18 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp [Note] cannot convert 'std::endl' (type '<unresolved overloaded function type>') to type 'signed char&'
40 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
774 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)
774 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template argument deduction/substitution failed:
20 18 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp [Note] cannot convert 'std::endl' (type '<unresolved overloaded function type>') to type 'unsigned char*'
40 0 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream In file included from c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\iostream
1 C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp from C:\Users\Parveen\Documents\CS10-2L LECTURES\try if it works.cpp
779 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)
779 5 c:\program files (x86)\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.8.1\include\c++\istream [Note] template argument deduction/substitution failed:
20 18 [Note] cannot convert 'std::endl' (type '<unresolved overloaded function type>') to type 'signed char*'
82 2 [Error] a function-definition is not allowed here before '{' token
254 1 [Error] expected '}' at end of input
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3647
  • View blog
  • Posts: 11,415
  • Joined: 05-May 12

Re: Hangman (Country Guessing Game)

Posted 28 June 2014 - 11:27 PM

Why do you have >> endl on line 20?
Was This Post Helpful? 0
  • +
  • -

#5 jimblumberg  Icon User is offline

  • member icon


Reputation: 4223
  • View blog
  • Posts: 13,245
  • Joined: 25-December 09

Re: Hangman (Country Guessing Game)

Posted 29 June 2014 - 05:12 AM

Also posted and answered here.

Jim
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1