在Eclipse中使用argc和argv? [英] Using argc and argv in Eclipse?

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

问题描述

我有一个工作程序,但现在我必须使用 int argc char * argv [] 参数到 main 。每当我尝试这样做,它给我的错误,它不能保存。有没有办法在Eclipse中使用 argc argv

解决方案

我想你的问题是,你不知道热传递参数给你的程序,当你通过eclipse执行它不是吗?



如果这是你想要的,请阅读以下内容。



点击项目 - >属性,然后在运行/调试设置点击新建按钮。选择C ++应用程序。在这里您可以看到有4个选项卡,第二个选项卡称为参数。
在此选项卡中,您可以看到一个textarea。在那里输入您的应用程序的参数,然后单击确定。
当您通过eclipse的播放按钮执行应用程序时,您的程序将被调用。


I have a working program but now I have to use the int argc and char *argv[] parameters to main. Whenever I try to do this it gives me errors that it cannot save. Is there any way to make argc and argv work in Eclipse?

解决方案

I guess your problem is that you don't know hot to pass argument to you program, when you execute it through eclipse isn't it ?

If that is what you want, read the following.

Click on the "Project->Properties" then in "Run/Debug settings" click on the "New button". Choose C++ application. Here you can see that there are 4 tabs, and the second tab is called "arguments". In this tab you can see a textarea. Type your application's argument there, and click "OK". When you will execute your application thanks to the "play" button of eclipse, your program will be called with arguments.

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

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