Topic
1 reply Latest Post - ‏2013-07-04T07:34:10Z by adevicq
bungle77
bungle77
11 Posts
ACCEPTED ANSWER

Pinned topic Optional Parameters

‏2013-07-03T14:10:43Z |

Hi is it possible to pass as optional a parameter to a method? How i need to define the method?

  • adevicq
    adevicq
    154 Posts
    ACCEPTED ANSWER

    Re: Optional Parameters

    ‏2013-07-04T07:34:10Z  in response to bungle77

    Hi,

    You must define several prototypes to do so. For example:

    void f(int a, int b) {
    ...
    }
    
    
    // defines f with a default value for the second parameter
    
    void f(int a) {
        f(a, 0)
    }
    

     

    regards,

    alain

     
    Updated on 2013-07-04T07:35:36Z at 2013-07-04T07:35:36Z by adevicq