devxlogo

Named Parameters in C++

Named Parameters in C++

Named parameters allow you to send function arguments in any sequence. This is very useful when your functions have long parameter lists. Named parameters are not supported in C++, but you can achieve the same functionality with this code:

class person;class Employee{public:	void setEmployeeDetail (person& p);	void setEmployeeDetail (const string& name, int age)	{ cout <

devx-admin

Share the Post: