On Thu 29 Sep 2011 11:13:54 PM IST, Todd Goodman wrote: > * Nilesh Govindarajan <cont...@nileshgr.com> [110929 13:33]: >> Default function arguments in C are specified like this: >> >> int func(int a = 10) {} // just a dummy function > > No they're not. C doesn't have default function arguments. > >> >> Now I save that in a file called foo.c >> >> The above piece of code is valid in C as well as C++ > > Uh, no it's not. > >> >> Why is this happening? O_o > > Because it's not correct C. > > Todd
Gah! so that's the reason. I've been coding C++ and other languages with default arguments that I forgot C. -- Nilesh Govindarajan http://nileshgr.com