Thank you so much for your helpful guidelines! Here is my working code now:
Code:
#include <iostream>
#include <string>
using namespace std;
string Print_Out();
string Check(int b);
string secret;
int a, b;
int main()
{
Print_Out();
Check(b);
return 0;
}
string Print_Out()
{
cout << "Test" << endl;
b = 2;
return secret;
}
string Check(int b)
{
if (5>b)
{
cout << "5 Is greater than 2" << endl;
}
else
{
cout <<"5 is not greater than 2" << endl;
}
return secret;
}
However I have another question. Is it really necessary to do Check(b); inside the function main?
If I change that to say, Check(a); with the variable declared globally the answer would still come out the same. The same result comes out if I do Check(5); as well.
Is it suppose to be like that or is there something I am doing wrong? I am using Microsoft Visual Studio 2010 by the way.