函数 _wtol 将宽字符串转换为长字符串。问题是它不能用小数转换。我对 C++ 的了解不够,无法提出解决方法,所以有人可以建议一个解决方法或一个可以用小数转换的替代转换函数吗?
谢谢
void button_click(void) {
Edit_LimitText(edithwnd, 100); // edithwnd is a global hwnd
wchar_t editxt[100];
GetWindowText(edithwnd, editxt, 100); // say I typed 36.56 in the edit control
long lng = _wtol(editxt); // when I pause during debug and look at my locals, lng would equal 36, but I need it to equal 36.56
}
最佳答案
_wtof() 等。参见 here .
关于c++ - 使用 _wtol 与小数转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5922907/