Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'ap' stand for in C examples?

Tags:

c

coding-style

For example, in the reference:

type va_arg (va_list ap, type)

Does ap stand for argument pointer? Something else?

like image 479
user3761340 Avatar asked Dec 09 '22 07:12

user3761340


1 Answers

That's actually an easy question to answer.

ap stands for argument pointer.

From The C Programming Language, Second Edition, Brian W. Kernighan and Dennis M. Ritchie:

7.3 Variable-length Argument Lists

[...] The type va_list is used to declare a variable that will refer to each argument in turn; in minprintf, this variable is called ap, for "argument pointer"

like image 139
ouah Avatar answered Dec 11 '22 10:12

ouah