The Dink Network

void?

March 2nd 2006, 04:53 PM
wizardb.gif
Phoenix
Peasant He/Him Norway
Back from the ashes 
I'm wondering if anyone knows whether or not the "void"s that appear between the parentheses here are necessary or if the script works just as well without them:

void main( void )
{
...
}

Thank ye in advance for your answers.
March 2nd 2006, 04:59 PM
spike.gif
I haven't used void for a long while and no complications thus far. Sometimes scripts even work without

void main()
{
}
March 2nd 2006, 06:02 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
It is not required... but I like it anyway. Heck, I think this even works correctly:

void main (
{
...
}
March 3rd 2006, 01:43 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Does this work too?

int main()
{
...
}
March 3rd 2006, 07:14 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
No... I'm fairly positive that the engine looks for the first void to figure out where procedures start.
March 4th 2006, 09:49 AM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
I think a normal C program requires
void main(void)
while a C++ program works with
void main()
March 4th 2006, 09:58 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
'void' is what it means: an emptyness. so void would give the same result as nothing at all.
March 4th 2006, 10:19 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
void means the return-value of the procedure/function/method (the name changes every decade or so ) is void though if the DinkC engine uses it to determine where procedures start in a DinkC script, it would be better to place them there anyway even if they don't serve any purpose for the functioning of the script.
March 5th 2006, 04:40 PM
wizardb.gif
merlin
Peasant He/Him
 
cypry: void main() is perfectly valid in a C program, and a C++ program requires main() to be of type int.