Sujet : Re: Named arguments in C
De : ifonly (at) *nospam* youknew.org (Opus)
Groupes : comp.lang.cDate : 04. Jul 2024, 10:45:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v65qvv$2n43t$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 02/07/2024 21:50, bart wrote:
On 02/07/2024 20:39, Blue-Maned_Hawk wrote:
int main(void)
{
f(.i = 0, .j = 2, .l = 2.5, .k = "foo", .n = 4.2, .m = 2.5);
}
This addresses a small part of it. Named parameters allow arguments to be omitted, and that requires also default values to be defined.
It actually allows parameters to be omitted, since one can omit struct members. And it also gets default values for these, but it's a fixed one, zero. So, that's limited. But possibly useful.
Not that I find obfuscating basic C syntax, like argument passing, behind a macro a good idea. But hey.