I am trying to use sscanf as follows:
CString word1, word2, word3;
CString word_string = "three word string";
sscanf(word_string, "%s%s%s", word1, word2, word3);
AfxMessageBox(word1);
I would expect this to display a dialog box containing "three", is that a correct understanding of what this *should* do?
It actually displays a dialog box containing "string". Further, I have verified that the CStrings word1, word2 and word3 all contain "string". The function returns a value of 3 as I would expect, indicating that it assigned values to three arguments.
I have checked out the CString class and don't see an equivalent method for doing this sort of thing. I saw the Format method that parallels sprintf but nothing like sscanf.
Is there any known bug here or is this a Unicode/MBCS issue or do I just have a misconception about syntax or function?
Any help would be appreciated.
CString word1, word2, word3;
CString word_string = "three word string";
sscanf(word_string, "%s%s%s", word1, word2, word3);
AfxMessageBox(word1);
I would expect this to display a dialog box containing "three", is that a correct understanding of what this *should* do?
It actually displays a dialog box containing "string". Further, I have verified that the CStrings word1, word2 and word3 all contain "string". The function returns a value of 3 as I would expect, indicating that it assigned values to three arguments.
I have checked out the CString class and don't see an equivalent method for doing this sort of thing. I saw the Format method that parallels sprintf but nothing like sscanf.
Is there any known bug here or is this a Unicode/MBCS issue or do I just have a misconception about syntax or function?
Any help would be appreciated.