swift func: i can't understand underscore as a parameter name that can compile -


how use underscore parameter

func test(currentname name: string, _: int) {      print("aa\(name) abc");     //how use  _  parameter? }  test(currentname:"aa", 3) 

_ means when call test function, don't have write text before second parameter test(currentname:"aa", 3)

if declare function this:

func test(currentname name: string, secondparameter: int) {         print("aa\(name) abc");     //how use  _  parameter? } 

then when call test function, must call this:

test(currentname:"aa", secondparameter: 3) 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -