Why add void to method parameter list

后端 未结 4 1934
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 06:53

I\'ve seen methods with the following signature:

void foo (void);

They take no argument, however I\'m wondering whether doing this is usefu

4条回答
  •  春和景丽
    2020-12-03 07:09

    In C++ code there is no reason whatsoever to use void in this way. What's more it is very much not the idiomatic way to declare parameterless functions.

提交回复
热议问题