由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - C++ output format problem
相关主题
test包子请帮忙,关于python
Re: help on interface for Matlab and Forfortran output 弱问题求助
问大侠Matlab编译成C的问题Fortran里面哪个函数显示系统时间?
请教一个小问题help fortran read format
Simulink M file based S-function 多个输入输出的问题Re: help fortran read format, why not try excel?
idb problemFortran77中
what's the standard ouput of gaussianCSC format matrix + CSC format matrix ?
急问一个面试题,不知该如何回答?请高人给个思路!谢谢!fortran求助!
相关话题的讨论汇总
话题: output话题: snprintf话题: 1000话题: swprintf话题: c++
进入Computation版参与讨论
1 (共1页)
S******y
发帖数: 1123
1
I am writing out my output to a txt file. It should be like -
10:
1.687
2.999
4.752
2.876
1.086
3.478
4.326
2.836
1.563
5.000
1000:
3.157
3.480
3.118
but now it is being output like this,which is wrong -
10:
1.6872.9994.7522.8761.0863.4784.3262.8361.5635.0001000:
3.1573.4803.118
where 10 and 1000 are ids, the other numbers are predicted ratings.
====================================================================
All I did was - changing "swprintf" in the original code to "_snprintf"
in the cod
c******a
发帖数: 51
2
try to change
_snprintf(pwzBuffer,1000,"%5.3f",rating);
to
_snprintf(pwzBuffer,1000,"%5.3f\r\n",rating);
S******y
发帖数: 1123
3
Thanks!
Why "/n" was not needed in the original code (wide character)?
swprintf(pwzBuffer,1000,L"%5.3f",rating);

【在 S******y 的大作中提到】
: I am writing out my output to a txt file. It should be like -
: 10:
: 1.687
: 2.999
: 4.752
: 2.876
: 1.086
: 3.478
: 4.326
: 2.836

1 (共1页)
进入Computation版参与讨论
相关主题
fortran求助!Simulink M file based S-function 多个输入输出的问题
问一个小问题idb problem
请教:如何使C++计算得到的结果直接生成所需要的曲线图?what's the standard ouput of gaussian
Protect cells' formatting急问一个面试题,不知该如何回答?请高人给个思路!谢谢!
test包子请帮忙,关于python
Re: help on interface for Matlab and Forfortran output 弱问题求助
问大侠Matlab编译成C的问题Fortran里面哪个函数显示系统时间?
请教一个小问题help fortran read format
相关话题的讨论汇总
话题: output话题: snprintf话题: 1000话题: swprintf话题: c++