Re: void parameter argument
- From: "Bruce Wood" <brucewood@xxxxxxxxxx>
- Date: 12 Apr 2005 00:42:56 -0700
AFAIK, the syntax
void function_name(void)
was introduced in ANSI C (or perhaps earlier) because the old, original
K&R C allowed function prototypes with "unspecified" arguments. So, in
C you could also say,
void function_name()
which did _not_ mean "this function does not take any arguments," but
rather "I'm not telling you what arguments this function takes, if
any." So, the "(void)" syntax was a necessary addition to distinguish
between this non-disclosure and a declaration that a function took no
arguments. It was a backward compatibility thing.
I suppose that it was left out in C# because it's superfluous. In a
language that requires you to declare all arguments, there's no need to
distinguish between the two cases with a keyword "void".
.
- References:
- void parameter argument
- From: Dan
- void parameter argument
- Prev by Date: Re: Capturing Close Events
- Next by Date: Re: void parameter argument
- Previous by thread: void parameter argument
- Next by thread: Re: void parameter argument
- Index(es):
Relevant Pages
|
Loading