What do you want ask and close to be? Integers? In that case int ask; int close;
Actually, I think Mr. Chance would like to call those two functions. That said, he's missing a few things...
@OP
You need to declare ask() and close() before the place where you call them. In your case, you need to declare them before main().
Second, you forgot the parentheses after ask() and close() when you called them in your functions. :)
Happy coding!
-Albatross
Last edited on
Thanks, but now I get:
1 2
|
main.cpp(24): error C4716: 'ask' : must return a value
main.cpp(33): warning C4715: 'close' : not all control paths return a value
|
New code:
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
|
#include <iostream>
#include <string>
using namespace std;
string subject;
string question;
int ask();
int close();
int main()
{
}
int ask()
{
cout << "ask";
getline (cin,subject);
cout << "output " << subject << endl;
cout << "repeat?";
getline (cin,question);
close();
}
int close()
{
if (question == "yes")
{
ask();
}
else return 0;
}
|
Last edited on
If you don't want to return a value declare it as
void ask();
There is nothing in main...
Last edited on
Thanks. It's working now.