Am 30.03.2023 um 21:32 schrieb Paul Gilmartin:
Does C use the CALL VL convention?

C has a portable solution for functions with a varying number of parameters,
that is the mechanism defined in the ANSI header <stdarg.h>

Most interesting, these sort of functions - like printf() and scanf() -
need to have a certain count of fixed parameters, which by there form and content
define the varying number of parameters which follow.

There is no need AND NO POSSIBILITY (on the mainframe, at least) to mark the last parameter in a certain way. And: the language definition doesn't say anything about an end mark of the parameter list; it only tells that the first (fixed) parameters must tell the function
how much parameters follow.

See printf as the best known example.

Other (simpler) functions may simply require the number of parameters as first parameter,
for example:

look_for_maximum (5, "John", "Fred", "Jim", "Henry", "Mike");

where 5 is number of strings, which follow.

HTH, kind regards

Bernd

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to