经过查阅资料,C++中的__wargv值是命令行参数。
VS中设置命令行参数的方法是,项目——属性——配置属性——调试——命令参数,设置命令参数就可以传入。
VS调试时,__wargv值为设置的参数。而双击运行该程序的exe文件时,__wargv值却只是exe文件的路径,并没有我在VS项目中设置的值。
请问,双击运行exe是不会传入命令行参数吗,VS生成exe文件的同时不会生成命令行参数设置的相关文件?
经搜索引擎搜索,没有查找到双击运行exe和VS调试时命令行参数的区别。各位大神如有相关资料,望告知。跪谢。
If you need to pass in parameters when running your exe program, you cannot double-click to run it. Instead, you should specify the parameters in the cmd console.
For example, if your program is called test.exe and you need to pass in the parameter "-c", then you can enter the path of test.exe in cmd and enter the command
test.exe -c
and press Enter to bring the parameters. Run your programWhen double-clicking to run vs is not in debugging state, of course there will be no parameters.
in the targetThe correct way is to create a shortcut and write