numbers coming out really weird

can some one tell me what in the world is wrong???


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

void welcome();
void goodbye();
int guess();

int main() 
{
	int num;

	welcome();
	guess();
	cout << guess << endl;
	goodbye();
    

system("pause");
return 0;
}

void welcome()
{
	cout <<"welcome to the guessing game" << endl;
}
void goodbye()
{
	cout << "thanks for playing" << endl;
}
int guess()
{
	int num;
	
	cout << "enter a number between 1 & 100" << endl;
	cin >> num;
	return num;
}
cout << guess << endl;
This seems to be an attempt to output a function (the function named guess). I suspect you actually wanted to do something like this:

cout << guess() << endl;
or
1
2
int returnedValue = guess();
cout << returnedValue << endl;
Topic archived. No new replies allowed.