命令行参数

https://baike.sogou.com/v7535000.htm;jsessionid=03B347877ED5AA5B9A4F2500F936009B

 

https://www.cnblogs.com/rainbow70626/p/5595454.html

 

 

C:\Documents and Settings\01\桌面\修订welcome2\welcome2\Debug\welcome.exe -1 -1 
在命令行中输入上面的一句话,用GetCommandLine()来获取输入的命令行

GetCommandLine() 获取输入的所有信息,包括程序所在路径及参数

 

调用CString cmdLine = GetCommandLine()
   得到“C:\Documents and Settings\01\桌面\修订welcome2\welcome2\Debug\welcome.exe -1 -1”

 

__argv[0]第一个参数//Lz的这个例子得到的应该是"C:\Documents and Settings\01\桌面\修订welcome2\welcome2\Debug\welcome.exe"这个字符串
__argv[1]第二个参数//"-1"
__argv[2]第三个参数//"-1"
posted @ 2021-04-06 10:20  远方是什么样子  阅读(41)  评论(0编辑  收藏  举报