+2

functions in c

whats the diff between void add( ) and void add(void)

3/21/2019 6:38:31 PM

Shikher Jaitly

2 Answers

New Answer

+2

They are the same; however if you use void add() as a function declaration, the function can take parameters, so the actual function definition might look like this: void add(int *a, int *b) { (...) } whereas if you use void add(void) as a function declaration, the function can't take parameters and if the function definition includes parameters, the code won't compile

+2

Maroon J In C++ there is no difference whatsoever. In C, Anna has already explained.