+ 1
Wat is the defrent between (1. Return by value/ 2. Return by refrence /3. Return by constant refrence ) in c++
function return types in c++
1 Resposta
+ 1
return by value
the variable passed in the function can change within but when returned it will be the same as it was enter in the function.
return by reference
the variable passed in by reference could change within the function. if it does then that is what it will end up being after the function call.
return by const
usually only used within classes to get a pmv this mean that Nothing can change within the function. it will only return one value