#include <iostream>
usingnamespace std;
int a_function(int a)
{
return a+1;
}
void b_function(int b)
{
cout << "value of original var + 1 is " << b << endl;
}
int main(int argc, char ** argv)
{
b_function(a_function(3));
// or
int f=1;
f = a_function(f);
b_function(f);
return 0;
}
int MyFunction()
{
return 5; // Pointless function, returns 5 for sake of example
}
int main()
{
if (MyFunction() == 5) // "If value returned from MyFunction equals five."
{
cout << "Hooray\n";
}
return 0;
}
// Alternatively, assign the results of that function to a variable
int main()
{
int result = 0;
result = MyFunction();
if(result == 5)
{
cout << "Hooray\n";
}
return 0;
}