:( 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 withthen all those would generate compiler errors. In C++Code:int foo(void)lmeans the same asCode:int foo();in C C++ will give out errors if you try and call the function with argumentsCode:int foo(void)
Thread: thanks tim
Results 1 to 30 of 91
Threaded View
-
06-14-2012
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)