3 ms·
> In classic C or C++, you would define a function taking optional arguments as : Is that true? Can classic C have default (optional) arguments?
by rdtsc 12y ago
> In classic C or C++, you would define a function taking optional arguments as :
Is that true? Can classic C have default (optional) arguments?
- Iftheshoefits 12y agoNo, classic C doesn't have default arguments.
- rdtsc 12y agoThat's what I thought.
- cremno 12y agovoid fun(int mandatory_arg, int optional_arg1 = 1, int optional_arg2 = 12, int optional_arg3 = 12); No, this isn't legal ISO C. There are ways to simulate them though: https://gustedt.wordpress.com/2010/06/03/default-arguments-for-c99/ https://gustedt.wordpress.com/2010/06/03/default-arguments-f...
- matt42 12y agoMy mistake, I just fixed the readme.