delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/14/16:45:40

From: sparhawk AT eunet DOT at (Gerhard Gruber)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A very basic question about C programming... diary of a newbie Part 1
Date: Fri, 14 Aug 1998 19:01:18 GMT
Organization: EUnet Austria
Lines: 40
Message-ID: <35d744df.5966153@news.Austria.EU.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980812131004 DOT 17366A-100000 AT is> <35D2A017 DOT 4808178C AT geocities DOT com> <35d30896 DOT 834512 AT news DOT Austria DOT EU DOT net> <35D3BC2B DOT 5F92B357 AT geocities DOT com>
NNTP-Posting-Host: e250.dynamic.vienna.at.eu.net
Mime-Version: 1.0
NNTP-Posting-Date: 14 Aug 1998 19:02:27 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Destination: Merlin <merlin__ AT geocities DOT com>
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: Fri, 14 Aug 1998 04:28:23 GMT:

>> The function(void) means that you specifically say that these function takes
>> no arguments. a call like this function(i) yields an error. If you leave the
>> void out then this means you don't give the compiler a hint what this function
>> takes. writing function() or function(i) or function(a, b, c, d, e) is
>> considered valid in this case, so leaving the void out is not the default vor
>> void. It is totaly different.
>
>wow...i didn't know this...i was told it was assumed...
>but i still suppose that leaving void out would be ok... I mean it would be silly
>to pass parameters to a function that didn't require any. So in effect it would
>turn out pretty much the same whether or not you specify void in the brackets or
>not...

Leaving the brackets empty doesn't say that this function take sno arguments,
it says only that there is a function. No info about any arguments. The
arguments may be 0, 1, 2, ..., but only if you say function(void) then it says
that the function takes exactly ZERO arguments.

--
Bye,
   Gerhard

email: sparhawk AT eunet DOT at
       g DOT gruber AT sis DOT co DOT at

Spelling corrections are appreciated.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019