This web page says:
C supports variable numbers of arguments.
Okay, I got that.
But there is no language provided way for finding out total number of arguments passed.
Really? Is that true?
Apparently it is true because in every example that I have seen of a function with a variable number of arguments, there is always an argument that specifies the number of arguments, e.g.,
int sum(int numargs, ...)
Isn't that cheating?
Isn't the whole point of a function with a variable number of arguments is for the function to figure out how many arguments are provided? (Not be told how many arguments are provided)
Is there no way to create a function that sums an arbitrary number of integers, without the caller telling the function how many integers there are? (And without forcing the caller to append some sort of sentinel value like NULL onto the end of their argument list)
Is this possible:
int sum(...)