why would you use foo<void> in C and not C++?
Thread: thanks tim
Results 1 to 30 of 91
Hybrid View
-
06-14-2012
-
-
06-14-2012
:( Well if you were wondering..
The reason to use foo(void) in C and not in C++ is because C++ is stricter about how functions are called.In C, if you leave out the (void) part, you can call the function with any amount of arguments
Code:int foo(); // defined somewhere // these are all valid, will not issue compiler errors foo(1, 2, 3, 4, 5); foo(); foo("hello", 1.2345, 1);
If you did declare it withCode:int foo(void)l
Code:int foo();
Code:int foo(void)
Last edited by syn; 06-14-2012 at 09:34 PM.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)