Article View: comp.lang.c
Article #707Re: variadic min and max, (any some and none, cat and more)
From: fir
Date: Fri, 23 Oct 2026 12:42
Date: Fri, 23 Oct 2026 12:42
36 lines
2065 bytes
2065 bytes
David Brown pisze:
> Variadic functions have no way of counting their arguments, or
> identifying their types.
this is silly becouse it cos t one register to use so its totally not a
problem
the case with various type arguments is much harder but the one with
"all ints" etc is quite easy
simpl as i said the user need the arg[] and arg_max avaliable
foo(int ...v)
{
for(int i=0; i<sizeof(v)/sizeof(int); i++)
{
}
}
i dont know maybe just same syntax can be used
foo(int[] v)
{
}
so you can put foo(tab) or foo(2,3,4,2,32,3,23,2) at will
thou this version would pass via pointer and is someone need to pass by
stack probably would need to use f(int ...) version
Technical Details
Message-ID:
<11bfko4$1q1en$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11bes8b$1gncr$1@dont-email.me> <11bf84v$1jkb5$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: variadic min and max, (any some and none, cat and more) Date: Fri, 23 Oct 2026 14:42:44 +0200 Organization: A noiseless patient Spider Lines: 36 Message-ID: <11bfko4$1q1en$1@dont-email.me> References: <11bes8b$1gncr$1@dont-email.me> <11bf84v$1jkb5$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 23 Oct 2026 12:42:45 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1902039"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1899FAIkukWiYErzRxi/NTM2xzYk4wI7EQ="; posting-host="43cad3fa7698c2e9be359f2072ea7249" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:Uvg3VWFZCT4FXmI9SANwncQfKXE= sha256:h2NyYI1Fz9qSKfzKG+Ud12De6z9tMzM/2O+YtALE1Qw= sha1:7VmyqF7Hv0J/4bQsrF8Ng/C/+1s= sha256:ashpoPAqat0OWPueg1MlaVEmJdO1pQKO2SkvQ2fY458= In-Reply-To: <11bf84v$1jkb5$1@dont-email.me>