我使用Visual C++ 2010,代碼爲:爲什麼在argv [0]的輸出中出錯?
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[]) {
printf("step 0: %s\n", argv[0]);
int d;
scanf("%d",&d);
return 0;
}
當我選擇_UNICODE,輸出爲「d」, 當我選擇_MBCS,它運作良好,並輸出爲「d: \ VCTest \ c1006.exe「
爲什麼在_UNICODE中出錯? 如何爲_UNICODE和_MBCS使用相同的代碼?
很難理解你在問什麼;闡述? – muhmuhten
@sreservoir:請參閱http://msdn.microsoft.com/en-us/library/c426s321%28v=vs.80%29.aspx,但這只是VS2005 – Zeta
'printf'不會執行unicode。 –