C 默认参数 [英] C default arguments

查看:19
本文介绍了C 默认参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 C 中为函数指定默认参数?

Is there a way to specify default arguments to a function in C?

推荐答案

并非如此.唯一的方法是编写可变参数函数并手动填写参数的默认值调用者没有通过.

Not really. The only way would be to write a varargs function and manually fill in default values for arguments which the caller doesn't pass.

这篇关于C 默认参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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