函数不定量的参数问题
2008-02-19 16:46
204 查看
头文件:
<stdio.h> and <stdarg.h>
1. va_list
typedef for pointer to list of arguments defined in STDIO.H
2.void va_start( va_list arg_ptr, prev_param );
Macro to set arg_ptr to beginning of list of optional arguments
3. void va_end( va_list arg_ptr );
Macro to reset arg_ptr
4. type va_arg( va_list arg_ptr, type );
va_arg retrieves a value of type from the location given by arg_ptr and increments arg_ptr to point to the next argument in the list, using the size of type to determine where the next argument starts
5.int vsnprintf(char *buff, size_t size, const char *format, va_list ap);
Each of these functions takes a pointer to an argument list, then formats and writes the given data to the memory pointed to by buffer.
<stdio.h> and <stdarg.h>
1. va_list
typedef for pointer to list of arguments defined in STDIO.H
2.void va_start( va_list arg_ptr, prev_param );
Macro to set arg_ptr to beginning of list of optional arguments
3. void va_end( va_list arg_ptr );
Macro to reset arg_ptr
4. type va_arg( va_list arg_ptr, type );
va_arg retrieves a value of type from the location given by arg_ptr and increments arg_ptr to point to the next argument in the list, using the size of type to determine where the next argument starts
5.int vsnprintf(char *buff, size_t size, const char *format, va_list ap);
Each of these functions takes a pointer to an argument list, then formats and writes the given data to the memory pointed to by buffer.
相关文章推荐
- js循环动态绑定带参数函数遇到的问题及解决方案[转]
- 关于带返回值委托函数和委托函数使用引用参数的问题
- 结构体变量和结构体指针变量作为函数参数传递的问题
- 指针作为函数参数的问题
- python调用c函数参数类型问题
- 函数指针参数的传递问题
- 函数参数入栈问题
- js函数参数传递,引号的问题,第二次犯错,记下来,以后不能犯了!
- python-关于函数间参数传递问题(注意理解,很容易混淆)
- 王爽-汇编语言-综合研究五-函数接收不定量参数
- 指针变量作为函数参数使用时注意的问题!
- 关于thinkphp中U函数传参数问题
- 在ActiveX中使用URLDownLoadToFile函数中的参数问题
- Python基础知识- 函数定义,参数问题(hard)
- 关于数组做函数参数的问题集合汇总
- 函数参数的传递问题->指针和内存
- JavaScript中函数作为参数进行传递时的括号问题
- Java中函数参数是值还是对象的问题
- javascript自定义函数传递参数的常见问题
- js函数参数默认值的问题