I'm quite new to learning the C++ language. Tried searching, but maybe I just don't understand the terminology correctly enough to know what to properly search for.
I'm learning about user defined functions, and was wondering what were the conventions for naming arguments/variables that are created in new functions. I know the code isn't perfect but I'm shortening it for conciseness.
int main()
{
int hours;
cout << "Enter hours: ";
cin >> hours;
int minutes;
cout << "Enter minutes: ";
cin >> minutes;
displayTime(hours, minutes);
return 0;
}
So now I will create, what I consider in my novice mind, dummy variables in the function being passed arguments to. What are the conventions for these names? Here are two examples to show possible names.
void displayTime(int a, int b) // new names totally different
cout << a << ":" << b << "\n";
}
or
void displayTime(int hours, int minutes) // same variable names
cout << hours << ":" << minutes << "\n";
}
Is there another, most accepted/common, option? I just want to make sure I start good habits with fundamental concepts. I'm using the C++ Primer Plus 6th edition, for what it's worth.