文章类型: VC&C++
关键词: VC程序提示,Expression:(“Buffer,too,small”,0),错误
内容摘要: VC程序提示 Expression:(“Buffer too small”,0) 错误

VC程序提示 Expression:(“Buffer too small”,0) 错误

2016/11/22 12:09:29    来源:apple    阅读:

错误:


VC程序运行时提示Expression:(“Buffer too small”,0) 的错误,但并不是每次都提示。

解决:


The call will fail if the string object itself is offered as a parameter to Format. For example, the following code:

    CString str = "Some Data";

    str.Format("%d%d", str, 123);      //Attention: str is also used in the parameter list.

    will cause unpredictable results.

    为了避免这种无法预见的问题,最好不要采取将字符串本身作为参数作为Format的参数,可以另外定义一个CString变量:

    cstring str,strTmp;

    strTmp="asd....";

    str.format("%s",strTmp);

这样问题就解决了。


↑ 上一篇文章:C++字符串格式化 sprintf、printf 关键词:C++字符串格式化,sprintf、printf 发布日期:2016/11/22 12:06:07
↓ 下一篇文章:VC++判断文件是否存在 关键词:VC++判断文件是否存在 发布日期:2016/11/23 10:36:22
相关文章:
Failed to load E:\SDK\android-sdk-windows\build-tools\26.0.1\lib\dx.jar 关键词:Failed,to,load,android-sdk-windows,build-tools,i.. 发布日期:2017-12-07 10:52
eclipse Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder! 关键词:eclipse运行错误提示Unknown,error:,Unable,to,build:,the.. 发布日期:2017-09-21 17:22
Android程序出现错误“Field requires API level 5 (current min is 4)”的解决 关键词:Android程序出现错误“Field,requires,API,level,5,(curren.. 发布日期:2017-09-22 16:37
相关目录:.NETVC&C++软件开发
我要评论
正在加载评论信息......