如何创建具有可变数量的参数的函数! [英] How to create a function with variable number of arguments !?

查看:96
本文介绍了如何创建具有可变数量的参数的函数!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何创建具有可变数量参数的函数!?
printf()这样做!

I am wondering how to create a function with variable number of arguments !?
printf() do that!

推荐答案

请参见此,例如: http://www.go4expert.com/forums/showthread.php?t=17592 [
See this, for example: http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html[^].

This is related to the order of parameters on stack. To use variable number of arguments, you need to use C calling conventions. This is pretty good explanation and code sample (referring to your printf, by the way): http://www.go4expert.com/forums/showthread.php?t=17592[^].

—SA


这篇关于如何创建具有可变数量的参数的函数!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆