The syntax for declaring and invoking functions with multiple parameters is a common source of errors. First, remember that you have to declare the type of every parameter. For example
void multiplyTwo(int num, string name) {
int total = num * 2;
cout << "Hi " << name << ", your total is " << total << "!" << endl;
}
int main() {
int x = 2;
string phil = "Phil";
}
multiplyTwo(int x, string phil);
Data types are not needed when calling a function.
multiplyTwo (x, phil);
Correct!
void multiplyTwo(int num, string name) {
This is the function definition.
void multiplyTwo(int x, string phil);
Data types are not needed when calling a function.