In python we can pass arguments to called function using argument name like in the following code , how can we do the same thing C++ , I needed this because ,if we have too many parameter it easy to mess up the location of the argument passed in called function and calling function
def calendar(year,month,day):
return "f{day}:{month}:{year}"
print(calendar(day=4,year=2021,month=9) #here arguments are passed in order of day,year and month
Output
"4:9:2021"
irrespective of passing parameters not in order as passed while defining function by using named arguments
string calendar(int year,int month,int day)
{
return year,month,day;
}
int main ()
{
cout<<calendar(" ? ");// How can we pass arguments like that of python in c++
}