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 code | X****r 发帖数: 3557 | 2 "%5.3f"改为"%5.3f\n"
【在 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
| S******y 发帖数: 1123 | 3 Thanks!
Why "/n" was not needed in the original code (wide character)? i.e.
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
|
|