openiolink / io-link-master-shield-hat-sw

Software for the IO-Link Master Shield/Hat for Arduino and Raspberry Pi
Apache License 2.0
25 stars 6 forks source link

Methods with no arguments #29

Closed gammeter closed 3 years ago

gammeter commented 3 years ago

In several modules in this library, there are methods with no arguments that are declared and/or defined like methodname() (empty argument list) and others like methodname(void). This should be unified. But which variant is correct for the C++ programming language?
I only know that in C a function with an empty argument list is implied to have one int argument where as foo(void) really has no argument.

maehne commented 3 years ago

In C++, you leave the parentheses empty if a function has no arguments.