今天用到了 __argc and __targv
#include <stdlib.h>
#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)
用起来很方便
本文介绍了如何使用__argc和__targv来处理命令行参数,并提供了代码示例。同时,还展示了另一种方法,即使用GetCommandLine和CommandLineToArgvW函数来达到相同的目的。
663

被折叠的 条评论
为什么被折叠?



