Anything like the c# params in c++?

后端 未结 4 1248
后悔当初
后悔当初 2021-02-18 19:26

That is the question.

4条回答
  •  生来不讨喜
    2021-02-18 20:11

    Yes. In standard C++, you can use va_arg and the ... syntax. See MSDN for details.

    For C++/CLI, There is a shortcut for this.

    You do this as:

    void TheMethod( String^ firstArgument, ... array^ variableArgs );
    

    See this blog post for details.

提交回复
热议问题