How to solve (Buffer too Small".0) problem?
来源:互联网 发布:mac windows10截图 编辑:程序博客网 时间:2024/05/24 01:10
CString WriteString;.... WriteString.Format("%s.%d d",WriteString,NI);
At above WriteString
the buffer too small warning is shown when executed any times because CString
type is not enough to hold string of any size.
My goal is to get content of WriteString
to write in to a file at end.
But it shows the warning when size of WriteString
reach to a limit. Is there any other way to write these strings to a file?or make the WriteString be of unlimited size.
Solution 1:
In the Format(..) context,
try to use the string as the receiver only :
CString cszComposed(_T("SomeValue")); ... CString cszTemp; cszTemp.Format(_T(".%d d"), NI); cszComposed += cszTemp;
Solution 2:
WriteString.AppendFormat("%du.",NI,CPianoCtrl::NoteUporDwn);
This also works.
- How to solve (Buffer too Small".0) problem?
- How to solve "LaTex:\headheight is too small"
- how to solve aliasing problem
- buffer too small
- buffer too small
- Buffer is too small
- How to Solve a Mathematics Problem?
- how to solve a math problem
- how to solve the problem we met?
- How to solve the Candy problem?
- How to solve TFS slow response problem?
- How to solve this problem oC
- c++ buffer is too small
- VC程序提示 Expression:("Buffer too small",0) 错误
- 关于sprintf_s,弹出Expression:(“Buffer too small”,0)
- How to solve the "undefined reference to '__sync_sub_and_fetch_4'" compilation problem
- How to solve the "undefined reference to '__sync_sub_and_fetch_4'" compilation problem
- str.Format 错误 Buffer too small
- 抽象类和接口的区别(php实例)
- c#多线程中Lock()关键字的使用
- C++多线程编程简单实例
- ExtJs4 笔记(1) ExtJs大比拼JQuery:Dom文档操作
- 14.智能(smart)指针,实现细节
- How to solve (Buffer too Small".0) problem?
- 浅谈C/C++内存泄漏及其检测工具
- 用GetLastError()来定位出错信息
- 【性能分析】初探VS2010中的Profile(性能剖析)功能
- 设计模式之一:组合模式
- android-Service和Thread的区别
- ExtJs4 笔记(5) Ext.Button 按钮
- Android 去掉横竖屏切换时的转屏动画
- lxc调用init流程