wat is teh difference between void before() n void inside ()
like void add()
and int function(void)?
wat is teh difference between void before() n void inside ()
like void add()
and int function(void)?
void add() = a function that has no return and has an unspecified number of parameters.
int function(void) = a function that has an int return and no parameters.
p.s. do you own homework
how do you know it is homework?
it just sounds like a noob question to me
perfectly ok to ask a question like that i think.
>void add() = a function that has no return and has an unspecified number of parameters.
>int function(void) = a function that has an int return and no parameters.
It really depends on whether or not the declaration is also a definition. The rules are convoluted because of old style function declarations, but it basically breaks down to this:
Code:void a(); /* Unspecified type and number of arguments */ void b(void); /* No arguments */ void c() { /* No arguments */ } void d(void) { /* No arguments */ }