Whats the difference between function(void); and function();?
Whats the difference between function(void); and function();?
I AM WINNER!!!1!111oneoneomne
void fun() is treated as
void fun(...) in C.
Here ... stands for ellipse, which means variable list of arguments
void fun() is treated as
void fun(void) in C++.
This means there is no real difference between void fun() and void fun(void) in C++.
Last edited by shiv_tech_quest; 01-13-2003 at 03:30 AM.
Have a wonderful day.... and keep smiling... you look terrific that way
signing off...
shiv... as i know him
when you use function(void) your compiler automatically assumes that its arguments are "void". Not sure about C but its definately like that for C++.
As far as I know, in C++, int func(void); and int func();
are exactly the same. Explicitly stating void just makes your intentions clear that the function takes no arguments.
-Futura
If you speak or are learning Spanish, check out this Spanish and English Dictionary, it is a handy online resource.
What happens is not as important as how you react to what happens. -Thaddeus Golas