dimanche 4 janvier 2015

Why can't auto be return type of a function? [duplicate]


My question is, why can't the return type of a function be deduced ? , or more simply why the following code gives error :



auto myfunc(int a)
{
int a = 12;
return a;
}


Why this isn't valid ?


Aucun commentaire:

Enregistrer un commentaire