> For the complete documentation index, see [llms.txt](https://fashaun.gitbook.io/dev-c/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fashaun.gitbook.io/dev-c/variable-length-argument.md).

# Variable-length argument

\#V-L-A

**用途:**

定義參數時無法事先知曉會傳遞的參數個數

**Head file:**

\#include stdarg.h

**不定長度引數使用幾個識別字來建立不定長度引數：**

va\_list

一個特殊的型態（type），在 va\_start、 va\_arg 與 va\_end 三個巨集（macro）中當作參數使用。

va\_start

啟始不定長度引數的巨集。

va\_arg

讀取不定長度引數的巨集。

va\_end

終止不定長度引數的巨集。

**函式定義:**

void function\_name (int length, ...);
