One of the uses of ... is to denote variadic entities in C and C++.`
Yes, In layman's terms ...
can be thought of as denoting more than one or multiples (as in pseudo-code punctuation we sometimes use multiple dots to resemble different types) of a use case, for which if we consider variadics (being multiple in the sense of 'varying' arguments/parameters) in C++, it would refer to a variable number of arguments for functions or templates.
What is its name?
Ellipsis
Is it classified as an operator or something else when used in that way?
No, it's definitely not an operator as it allows you to pass any number of arguments, not operate on them.
Any other details regarding ...?
As far as I know -
- Its a special specifier;
- The ellipsis always comes last in the argument list;
- As far as its usage is concerned, its only used when you want to remove the limits on the number of parameters for a template/function or when you require to have an extensible number of parameters for expansion. (i.e. it provides parameter pack expansion in a variadic class template or function template) In practice we mostly require a fixed set of known parameters, so it isn't applicable to most cases;
- It can be used with
sizeof
operator, as it's classified as a pack expansion as well.
Edit: I know the purpose of ...
I am asking about its name and classification, which I hope, is similar in both C and C++.
The name is same, but usage may vary for C++ and C.
Am only familiar with its use in the former language. (I remember having a HackerRank problem on Variadics, covering its utility.)