c++格式说明符不工作
C++ Format Specifier not working
在portaudio回调中,我正在运行循环直到framesperbuffer变量。通过调试,名为的for循环变量cnt是递增的,但格式说明符先打印256,然后打印0。即使我使用tmp.Format(_TEXT("-%d-",3)
,我在CString中得到0。
这是我的一段代码,我使用visual studio 2010,也尝试了_T和_TEXT没有错误生成
float *inp=(float*)inputBuffer;
float *outp=(float*)outputBuffer;
CString str;
CString tmp;
for(unsigned int cnt=0; cnt< framesPerBuffer; cnt++)
{
tmp.Format(_TEXT("-%d-",cnt));
str.Append(tmp);
}
只是一个放错位置的父级。在_TEXT()宏参数列表中有一个int参数给Format,所以它根本没有被传递给Format
这个应该会更好:
tmp.Format(_TEXT("-%d-"),cnt);
相关文章:
- 激励'inline'说明符的真实世界示例?
- QSqlquery prepare()和bindvalue()不工作
- 导入库可以跨dll版本工作吗
- 缺少类型说明符,显式类型为"缺少错误"
- 以螺旋方式打印矩阵的程序.(工作不好)
- 对象指针在c++中是如何工作的
- 为什么在Windows上的VS 2019和Clang 9中"size_t"在没有标题的情况下工作
- VSOMEIP-2个设备之间的通信(TCP/UDP)不工作
- 为字符串中每 N 个字符插入空格的函数没有按照我认为的方式工作?
- C++为线程工作动态地分割例程
- 为什么我的 std::ref 无法按预期工作?
- 布尔比较运算符是如何在C++中工作的
- SampleConsensusPrerejective(ext.RANSAC)是如何真正工作的
- 不确定要在我的main中放入什么才能使我的代码正常工作
- 为什么std::condition_variable notify_all的工作速度比notify_one快(对于随机请
- <<操作员在下面的行中工作
- 访问说明符(私有/公共/受保护)如何在内部工作(限制成员访问)?
- c++格式说明符不工作
- 友元说明符在c++中的工作原理
- C++17异常说明符类型系统将如何工作