Pull integer from void to display in int main

I'm trying to write a program that's more or less a flow chart. Right now I'm stuck. Basically I want to pull int a from my first question and just get it to display in the main function, but I can't seem to figure out how. Any ideas?

#include <iostream>

using namespace std;

void QuestionA()
{
char answer_1;
int a;

cout << "Is it tons of fun?" << endl;
cin >> answer_1;
a = answer_1 + 0;
if (answer_1 == 121) cout << "I bet it is!" << endl;
else cout << "Liar!" << endl;

}

int main()
{
int a;

cout << "Should you take time off for that new videogame?\nBefore you do, ask yourself the following:" << endl;
a = 0;
QuestionA();
cout << a << endl;

return 0;

}
Return int from function?
Use reference or pointer parameter in your function
Topic archived. No new replies allowed.