C

Asked • 03/27/19

Is it better to use C void arguments "void foo(void)" or not "void foo()"?

What is better: `void foo()` or `void foo(void)`?With void it looks ugly and inconsistent, but I've been told that it is good. Is this true?Edit: I know some old compilers do weird things, but if I'm using just GCC, is `void foo()` Ok? Will `foo(bar);` then be accepted?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.