0x777C
0x777C

Reputation: 1047

Are there any programming languages that limit the number of arguments to a function?

And by limit I mean something reasonably low (let's say less than 64) so as to exclude C etc.

Upvotes: 2

Views: 114

Answers (2)

Evan Benn
Evan Benn

Reputation: 1689

C90 is limited to:

—127 parameters in one function definition
—127 arguments in one function call
—127 parameters in one macro definition
—127 arguments in one macro invocation

At minimum. Implementations can support more, but 'portable' code can only rely on 127.

Upvotes: 1

davidtgq
davidtgq

Reputation: 4000

Java is limited to 255: https://stackoverflow.com/a/30581726/4698922

The number of method parameters is limited to 255 by the definition of a method descriptor (§4.3.3), where the limit includes one unit for this in the case of instance or interface method invocations.

Upvotes: 1

Related Questions