可能重複:
In a C function declaration, what does 「…」 as the last parameter do?這是什麼在函數在C年底,...)++
這是什麼意思,...);
它是在一個函數的末尾寫在我正在調試的代碼中。
這樣void abc(int a, int b, ...);
可能重複:
In a C function declaration, what does 「…」 as the last parameter do?這是什麼在函數在C年底,...)++
這是什麼意思,...);
它是在一個函數的末尾寫在我正在調試的代碼中。
這樣void abc(int a, int b, ...);
表示該功能可以採取任何數量的額外的參數。例如,考慮printf;第一個參數是格式字符串,然後對於所有的修飾符,可以有任意數量的參數。在定義函數時,這將在第一個參數後面使用...表示。
指定可以使用cstdarg
header中的宏訪問的可變數量的參數。
作爲C++編碼器,您最好不要使用省略號。 http://www.learncpp.com/cpp-tutorial/714-ellipses-and-why-to-avoid-them/ – DumbCoder 2010-07-20 07:39:17