如何调用外部程序?

编程入门 行业动态 更新时间:2024-10-23 05:40:20
本文介绍了如何调用外部程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

C ++中是否有一种标准方式可以调用外部程序,或者这是否取决于b $ b平台? 如果它依赖于平台,有人可以放弃一行使用什么或 哪里可以在RedHat上查找GNU C ++的信息?我正在做一些数值 计算,需要调用外部绘图程序(gnuplot) 并返回数字。 对不起,如果我发了两次。 谢谢, 三义

Is there a standard way in C++ to call an external program or is this platform dependent? If it is platform dependent, can somebody drop a line what to use or where to look for info for GNU C++ on RedHat? I am doing some numerical calculations and need to invoke an external plotting program (gnuplot) and return to the numerics. Sorry if I posted twice. Thanks, Sanyi

推荐答案

2003年12月13日星期六22:48:28 -0500,Sanyi Benczik写道: On Sat, 13 Dec 2003 22:48:28 -0500, Sanyi Benczik wrote: C ++中是否有标准的方式来调用外部程序,或者这是平台依赖? 如果它依赖于平台,有人可以放弃使用什么或者在RedHat上查找GNU C ++信息的位置?我正在进行一些数值计算,需要调用外部绘图程序(gnuplot)并返回数字。 Is there a standard way in C++ to call an external program or is this platform dependent? If it is platform dependent, can somebody drop a line what to use or where to look for info for GNU C++ on RedHat? I am doing some numerical calculations and need to invoke an external plotting program (gnuplot) and return to the numerics.

我不喜欢我不知道这与平台无关,但是< stdio.h>包含: FILE * popen(const char *命令,const char *类型); 这允许您打开一个程序并读取stdin(r)或者以与fopen相同的方式写出stdout (w)。 可能有更好的解决方案,但这是第一件事来了 想到。 -Brian

I don''t know how platform independent this is, but <stdio.h> contains: FILE *popen(const char *command, const char *type); This allows you to open a program and either read stdin ("r") or write stdout ("w") in the same manner as fopen. There is probably a better solution, but this is the first thing that came to mind. -Brian

man system 3 Sanyi Benczik写道: man system 3 Sanyi Benczik wrote: C ++中是否有标准的方式来调用外部程序或者这个平台是否依赖? 如果它是依赖于平台的,有人可以放弃使用什么或者在RedHat上查找GNU C ++的信息?我正在做一些数值计算,需要调用一个外部绘图程序(gnuplot)并返回数字。 如果我发布了两次,我很抱歉。 <谢谢, Sanyi Is there a standard way in C++ to call an external program or is this platform dependent? If it is platform dependent, can somebody drop a line what to use or where to look for info for GNU C++ on RedHat? I am doing some numerical calculations and need to invoke an external plotting program (gnuplot) and return to the numerics. Sorry if I posted twice. Thanks, Sanyi

Sanyi Benczik< sb ****** @ vt.edu>在消息新闻中写道:< br ********** @ solaris.cc.vt.edu> ... Sanyi Benczik <sb******@vt.edu> wrote in message news:<br**********@solaris.cc.vt.edu>... C ++中是否有标准的方式来调用外部程序或者这个平台是否依赖? 如果它依赖于平台,有人可以放弃使用什么或者在RedHat上查找GNU C ++信息的位置?我正在做一些数值计算,需要调用一个外部绘图程序(gnuplot)并返回数字。 如果我发布了两次,我很抱歉。 <谢谢,三义 Is there a standard way in C++ to call an external program or is this platform dependent? If it is platform dependent, can somebody drop a line what to use or where to look for info for GNU C++ on RedHat? I am doing some numerical calculations and need to invoke an external plotting program (gnuplot) and return to the numerics. Sorry if I posted twice. Thanks, Sanyi

我不确定,但也许System(char *)可能看起来很有帮助......那么你 可以将输出传输到您的程序或其他东西。

I am not sure, but maybe System(char *) might seem helpful... Then you can pipe the output to your program or something.

更多推荐

如何调用外部程序?

本文发布于:2023-10-28 19:21:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537551.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!