由买买提看人间百态

topics

全部话题 - 话题: swprintf
(共0页)
S******y
发帖数: 1123
1
来自主题: Quant版 - "swprintf" and "_snprintf"
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
t****t
发帖数: 6806
2
来自主题: Programming版 - how to convert an integer to a widestring
c99 (c89???) defined swprintf in
i believe it is widely available in all kinds of compiler/library before c99
for c++, use wstringstream (wostringstream) for maximum compatibility.
S******y
发帖数: 1123
3
来自主题: Programming版 - C++ output format problem
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
S******y
发帖数: 1123
4
来自主题: Programming版 - C++ output format problem
Thanks!
Why "/n" was not needed in the original code (wide character)? i.e.
swprintf(pwzBuffer,1000,L"%5.3f",rating);
S******y
发帖数: 1123
5
来自主题: Computation版 - C++ output format problem
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
S******y
发帖数: 1123
6
来自主题: Computation版 - C++ output format problem
Thanks!
Why "/n" was not needed in the original code (wide character)?
swprintf(pwzBuffer,1000,L"%5.3f",rating);
S******y
发帖数: 1123
7
来自主题: Statistics版 - C++ output format problem
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
(共0页)