命令行參數技巧:__argc,__argv

幾個可使用的全局變量:ide

_CRTIMP extern int __argc;          /* count of cmd line args */
_CRTIMP extern char ** __argv;      /* pointer to table of cmd line args */
_CRTIMP extern wchar_t ** __wargv;  /* pointer to table of wide cmd line args */

 __argc、__argv、__wargvspa

 

若是是MFC項目,可使用CWinAppm_lpCmdLine變量,注意這個m_lpCmdLine中不包含應用程序自身路徑。code

相關文章
相關標籤/搜索