jeudi 7 septembre 2023

Are there any differences between these two in C++? (1) auto rtn = f(a,b); return rtn; (2) return f(a,b); [duplicate]

Is there any difference between these two in C++?

  1. auto rtn = f(a,b); return rtn;

  2. return f(a,b);

If so, what are the differences? If not, when/why do we prefer to use the second format?

I want to understand the return statement. In return statement;, can the "statement" be a function call? What is the meaning of this? I saw such code and I'm trying to understand it.

Aucun commentaire:

Enregistrer un commentaire