现在的位置: 首页 > 综合 > 正文

__argc and __targv

2013年03月15日 ⁄ 综合 ⁄ 共 246字 ⁄ 字号 评论关闭

今天用到了 __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)

用起来很方便

抱歉!评论已关闭.