是 argc &argv 在 Windows 中没用? [英] Are argc & argv useless in Windows?

查看:33
本文介绍了是 argc &argv 在 Windows 中没用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 linux 中,argc 和 argv 计算终端中的参数.但是在 Windows 中,我找不到放置第二个参数的地方.实际上每次我运行程序时,它都会创建一个丑陋的黑色窗口,我什至没有机会提出任何论点.那么这两个变量在 Windows 平台下是没有用的呢?或者有另一种使用方法?

In linux, argc and argv count arguments in terminal. But in Windows, I can't find anywhere to put the second arguments. Actually every time when I run the program, it creates that ugly black window and I even have no chance to give any argument. So are these two variables useless in Windows platform? Or there's another way to use it?

推荐答案

如果你从命令提示符开始,你可以在那里给出参数.

If you start from the command prompt, you can give the arguments there.

开始菜单->运行->cmd"->MyProgram.exe arg1 arg2"

Start menu -> run -> "cmd" -> "MyProgram.exe arg1 arg2"

这篇关于是 argc &argv 在 Windows 中没用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆