CLion-命令行程序参数 [英] CLion - command line program arguments

查看:168
本文介绍了CLion-命令行程序参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我分配给运行/调试配置时,有人可以告诉我JetBrains CLion怎么了吗-程序参数类似 aaa bbb,然后打印出来:

Can anyone tell me what wrong with JetBrains CLion, when I assign to Run/Debug Configurations - Program arguments something like "aaa bbb" and then print it:

printf("%s\n", argv[1]);

我刚得到 aaa,当它必须为 aaa bbb时,因为它们用双引号引起来。

I just got "aaa", when it must be "aaa bbb" because they are in double quotes.

图片-这就是我得到的

编辑:在其他IDE(Dev C ++,Codelite)中进行了测试,并且可以工作。只有Clion没有:(只是简单的事情,无法弄清楚...

tested in other IDEs (Dev C++, Codelite) and it works. Only Clion does not :( Just simple thing and can not figure it out...

推荐答案

这似乎是一个错误CLion。对我来说,它仅在我启动应用程序而不对其进行调试时发生(运行>运行测试)。当我在调试模式下运行(运行>调试测试)时,它运行正常并显示整个字符串。

This appears to be a bug in CLion. For me, it only happens when I start the application without debugging it (Run > Run 'Test'). When I start in debug mode (Run > Debug 'Test'), it works fine and displays the whole string.

我创建了 JetBrains的问题。一旦收到他们的回复,我会立即更新此答案。

I've created an issue with JetBrains. I'll update this answer as soon as I hear back from them.

这篇关于CLion-命令行程序参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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