Return several arguments for another function by a single function

前端 未结 6 1975
余生分开走
余生分开走 2021-01-03 05:31

This question was closed as exact duplicate since I chose a misleading question title. It was not wrong but suggested an issue often discussed, e.g. in this question. Since

6条回答
  •  失恋的感觉
    2021-01-03 05:38

    we can only return one value. but in case you want to return multiple value you can use an array or define a object or a structure

        int* arguments() {
            int x[1,4,6] 
            return x;
        };
    
        void length(int i[]);
    
        length(arguments());
    

提交回复
热议问题