answersLogoWhite

0


Best Answer

I'm not sure I understand you as it wouldn't make sense for a function to return a default value.

Do you actually mean can a function return an argument that has a default value? If so, then yes. Any argument passed to a function, whether defaulted or not, can be returned by the same function. If the argument is passed by value then you must return it by value. If passed by reference (which cannot be defaulted) then you can either return by reference or by value. However, if you pass by non-constant reference then you can just use the reference as an output argument, and use the actual return value for some other purpose, such as reporting any error condition(s) created by the function.

Overloaded functions are no different to ordinary functions, the only criteria is that each overload has an unique signature. The return value does not form any part of the signature, thus signatures cannot differ by return type alone.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: CAN Overloaded functions can return default values?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why the functions of java is called methods?

because it is capable of taking parameters, passing or returning values as in c++. it has it's own identity as return type, and signature of the method body. It can also be overloaded as well.


When a function is overloaded there are multiple definitions of the functions What makes the various definitions of the function different from each other?

Their parameter-lists and returns values.


Write function integerpower that return the value of base exponent?

write a scripting to return values in functions


What is overloaded subprogram?

subprogram overloading is a process of using the same (function) name for many subprograms. the overloaded subprograms may differ in the number, type or order of its its parameters.java, c++ and c# provides the feature of subprogram overloading . when an overloaded subprogram is called,java or c++ compiler first checks the subprogram name and then the number and type of parameters are analyzed to decide which version of the overloaded subprogram must be chosen for execution. this process is also known as 'polymorphism'. the return type of a subprogram has no affect on subprogram overloading whereas it is used to differentiate between the calls in ADA. hence,two overloaded functions in ADA can have the same parameter profile with different return values.


Write a program to return a function using class in C Plus Plus?

Classes cannot return values, only functions can return values. But you cannot return a function from a function, you can only return a function pointer -- a pointer variable holding the address of the function you wish to return. All possible return values must be of the same type, therefore all function signatures and return types must be exactly the same -- only the name of the functions can differ.

Related questions

Why the functions of java is called methods?

because it is capable of taking parameters, passing or returning values as in c++. it has it's own identity as return type, and signature of the method body. It can also be overloaded as well.


Why function should return a value?

Not all functions return values. If you take a function which is of type void, you get a function which is does not return anything. The only functions which should return values are those which are used as a right side of expressions (so called rvalues).


When a function is overloaded there are multiple definitions of the functions What makes the various definitions of the function different from each other?

Their parameter-lists and returns values.


Write function integerpower that return the value of base exponent?

write a scripting to return values in functions


What is overloaded subprogram?

subprogram overloading is a process of using the same (function) name for many subprograms. the overloaded subprograms may differ in the number, type or order of its its parameters.java, c++ and c# provides the feature of subprogram overloading . when an overloaded subprogram is called,java or c++ compiler first checks the subprogram name and then the number and type of parameters are analyzed to decide which version of the overloaded subprogram must be chosen for execution. this process is also known as 'polymorphism'. the return type of a subprogram has no affect on subprogram overloading whereas it is used to differentiate between the calls in ADA. hence,two overloaded functions in ADA can have the same parameter profile with different return values.


Write a program to return a function using class in C Plus Plus?

Classes cannot return values, only functions can return values. But you cannot return a function from a function, you can only return a function pointer -- a pointer variable holding the address of the function you wish to return. All possible return values must be of the same type, therefore all function signatures and return types must be exactly the same -- only the name of the functions can differ.


Why ternary operator is not overloaded?

The ternary operator (known as the conditional operator in C++) cannot be overloaded because it is impossible to pass a test operand and two expression operands (either or both of which may be comma-separated) to a function. You can only pass values or references as arguments to a function. Even if it were possible, built-in functions and operators that rely on the conditional operator would likely break. Like all the other operators that cannot be overloaded (sizeof, typeid, ::, . and .*) the results must always be predictable because built-in operators and functions rely on them so heavily.


If troubleshooting a boot problem what is the advantage of restoring all UEFIBIOS setting to their default values?

The main disadvantage to restoring all CMOS settings to default values is losing custom settings to optimize CMOS functions. The operating system may malfunction and perform improperly as well.


How useful is the vlookup in Excel computation?

Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.Vlookup is a complex but useful function in Excel. It allows you to search through tables for a value and return a corresponding value. It is one of a set of functions that enables you to search data and find values. See the related question below.


What is default in tagalog?

Default in Tagalog can be translated as "pangkaraniwan" or "karaniwan".


What are the numbers formulas and functions used in calculations called?

You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.You can refer to them generally as values. Formulas can use operands and functions use arguments.


What category in Excel returns a true or false value?

Excel has a category called Logical Functions. The IF function is the one of those that most people use and associate with returning True or False values. Other functions also return True or False values. There is a TRUE function and a FALSE function. The OR function and the AND function can be used to return True or False values too. The NOT function can reverse a True or False value, so it also returns True or False.