如何调用外部程序? [英] how to call an external program?

查看:55
本文介绍了如何调用外部程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.


这篇关于如何调用外部程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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