将命令行参数传递给C文件并从C文件返回答案 [英] Passing command line arguments to C file and returning answers from C file
本文介绍了将命令行参数传递给C文件并从C文件返回答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的算法中包含c语言文件,并且我已经完成了命令行参数。我已经编译了文件并获得了汇编器输出文件。现在我需要将值传递给perl脚本的c文件输出,并从c文件中获取值。需要帮忙。
提前感谢。
我的尝试:
我对perl脚本不是很熟悉。
解决方案
你可能会发现很多例子和网络上的教程,只使用谷歌。例如,请参阅:
从Perl运行带有系统的外部程序 [< a href =https://perlmaven.com/running-external-programs-from-perltarget =_ blanktitle =New Window> ^ ]。
< blockquote>你可能需要尝试一些不同的方法 - 在Perl中有很多选项 - 正如其他人所说的那样,谷歌会找到一些,但是,这里是一个简单的,使用'反引号'
my
str
=`your-prog arg1 arg2 .. argn`;
I have c language file with my algorithm in it and I have done command line arguments. I have compiled the file and got the assembler output file also. Now I need to pass values to my output of c file from perl script and get back the values from c file. Need help.
thanks in advance.
What I have tried:
I am not very familiar with perl scripting.
解决方案
You may find many examples and tutorials on the web, just using Google. See, for instance:
Running external programs from Perl with system[^].
you may need to try a few different approaches - in Perl there are heaps of options - as others have said, Google would find some, but, here's a simple one, using 'backticks'
my
str = `your-prog arg1 arg2 .. argn`;
这篇关于将命令行参数传递给C文件并从C文件返回答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文