幾個可使用的全局變量: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項目,可使用CWinApp的m_lpCmdLine變量,注意這個m_lpCmdLine中不包含應用程序自身路徑。code