i heard that it was int but later it is deprecated , so at present what is the default return type of a function ?
at present what is the default return type of a function?
Collapse
X
-
Depends.
In C if you don't specify a return type, int was assumed.
In C++ there is no default return type.
You are always better off specifying the correct return type. Remember, a function is an instance of it's return type. When you assign a function call to a variable, the compiler checks the return type to see if calling the function will produce a value that can be assigned to that variable. -
-
function return int by default in C..
But if you want to return any other value then you have to specify it in Function ProtypeComment
Comment