今天用到了 __argc and __targv
#include
<
stdlib.h
>
#include < tchar.h >
#include < iostream >
for ( int i = 0 ; i < __argc; ++ i)
... {
std::cout<<__targv[i]<<std::endl;
}
#include < tchar.h >
#include < iostream >
for ( int i = 0 ; i < __argc; ++ i)
... {
std::cout<<__targv[i]<<std::endl;
}
还有另一种方式:
LPTSTR GetCommandLine(void);
配合 LPWSTR CommandLineToArgvW(LPWSTR cmdline,int pnumArgs)
用起来很方便