TYT的网站

c++ 不定长参数,取参数大小

2018-12-14 09:52 Python· 点击 692

有时用到c++的不定长参数,来传递字符串,事先需要知道字串大小。

不然用到

_vstprintf_s ,这些语句时,就assert,说"buffer too small"

所以查询字串大小时,用到

va_start(aaa,bbb);

int len = _vscwprintf(aaa,bbb);    //

返回列表
浏览 新增 设置