910702-Linux中的vscprintf等效项? [英] 910702 - vscprintf equivalent in Linux?

查看:712
本文介绍了910702-Linux中的vscprintf等效项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 Linux下_vscprintf的等效功能是什么?
thx

解决方案

嗯,这很棘手! :-)我一直使用 vsnprintf() [ vsnprintf() [ ^ ]

hi what''s the equivalent function for _vscprintf under Linux?
thx

解决方案

Well, this is tricky! :-) I have always used vsnprintf()[^] to do the job by specifying NULL and zero as the first two parameters. If you look at the documentation and check out what it says about the return value you will see that this is perfectly valid usage of the function!

EDIT: The same function in the VC++ crt isn''t compatible with the linux version, the windows version returns -1 when the output needs to be truncated. See the docs: vsnprintf()[^]


这篇关于910702-Linux中的vscprintf等效项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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