All these functions are outside the int main():
int func1(int x) {
int v1 = 6 * x;
return v1; // the input argument will be 2, so v1 = 12
}
int func2()
Could you clarify your question? From my understanding you're doing what you want correctly.
double add_5(double x) {
return x + 5;
}
double nested_method(double x) {
double myVariable = add_5(x); //my variable = x + 5
//other code//
return myVariable;
}
int main() {
double myInput = 123;
std::cout << nested_method(myInput) << std::endl; //output should = 128
}
If a method asks for 'n' parameters to call the method you must give it each of those 'n' parameters (of the apropriate type).
ignoring overloads / default values etc