Default values for function are specified from left to right only - Functions

Q.  Default values for a function are need to be specified from left to right only.
- Published on 17 Jul 15

a. True
b. False

ANSWER: False
 

    Discussion

  • Raj   -Posted on 09 Oct 15
    Default values for a function are need to be specified from left to right only is false statement.

    Default value in a function as an argument should be right to left.
    For example consider the following function prototype.
    Int myFunction (int Parameter1, int Parameter2, int Parameter3);
    You can assign a default value to Parameter2 only if you have assigned a default value to Parameter3. You can assign a default value to Parameter1 only if you have assigned default values to both Parameter2 and Parameter3.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)