Hi all.

I have a question with wscanf function.

1
2
3
4
5
6
7
8
int i = 12;
wchar_t num[1024];// = _T("123");
int key = readKey(num, 1024);
if(key > 0 )
         wscanf(num,_T("[%d]"),&i);
     
wprintf(_T("%ls : %d"),num,i);
return 0;


Input : 23
Output:
23
23 : 12

Why the output is 23:12 but not 23:23

:)
wscanf(num,_T("[%d]"),&i);
An error Occurred in this statement.
You can get the error code form errno.
Maybe,errno is 29.
What does readKey() do?
Topic archived. No new replies allowed.