#126: tcl function with default arguments
proc add {a {b 5}} { return [expr $a+$b] } puts [add 10 12] puts [add 12]
Output:
22 17
Oct 8, 2020 | tcl | 0 comments
#126: tcl function with default arguments
proc add {a {b 5}} { return [expr $a+$b] } puts [add 10 12] puts [add 12]
Output:
22 17
Subscribe now to keep reading and get access to the full archive.
Recent Comments