Jack Klein wrote:[color=blue]
> On Wed, 01 Jun 2005 11:44:44 -0400, Pete Becker <petebecker@acm.org>
> wrote in comp.lang.c++:
>
>[color=green]
>>Pretend it says this:
>>
>>struct stat
>>{
>>// whatever...
>>};
>>
>>extern int STAT(const char *, struct stat *);
>>
>>struct stat st; // defines object of type struct stat
>>STAT(fileName.c_str(), &st); // call STAT
>>
>>This is a quirk in the standard C library: there's a struct named 'stat'
>>and a function named 'stat'. When you say "struct stat" you're talking
>>about the struct; when you say "stat" you're talking about the function.[/color]
>
>
> If it was anyone who didn't work for Dinkumware, I'd have to point
> that the problem is not with the "standard C" library.
>
> Oh, what the heck, I just did that anyway.
>[/color]
Good point. It's not the standard C library; it's the usual C library,
i.e., a UNIXism incorporated into POSIX and into most C libraries. I
don't know of any other code that does this, and it required a change to
the original grammar in C++ to make it work.
--
Pete Becker
Dinkumware, Ltd. (
http://www.dinkumware.com)