Im used to programming in Java as it was my first language to learn.

In C++ is...

int myFunc(void);

equal to

int myFunc();

I was doing a number of tests, but the answer was still unclear...

Recommended Answers

All 3 Replies

The first version you posted is explicit, and, in my limited experience, is unnecessary.

Just use the second version if you have no input arguments; there's no difference.

The first version you posted is explicit, and, in my limited experience, is unnecessary.

Just use the second version if you have no input arguments; there's no difference.

There is a difference between the two in C or C++.
http://david.tribble.com/text/cdiffs.htm#C99-empty-parm

Good to know. Thanks, Dave!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.