2012-07-09 19 views
1
void foo(const gchar *a, ...) 
{ 
    do_something(); 
} 

...是什麼意思?函數...在C中的參數

它只適用於glib嗎?

+6

http://en.wikipedia.org/wiki/Variadic_function – Mysticial 2012-07-09 02:21:26

+0

@Mysticial我只是不知道如何命名它。謝謝! – hbc 2012-07-09 02:24:51

+0

見[n1256](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf)第7.15節。 – 2012-07-09 03:46:21

回答

2

它是variable-length argument list它允許函數具有靈活的參數數量。這是標準的一部分。所以它支持標準C(或者支持這個特性本身),而不僅僅是glib。