- 1. 概要
1. 概要
#include <stdlib.h>
int system(const char *string);
てのがありまして。
string にコマンドをいれるとコマンドを実行してくれます。
こいつでコマンドからの出力があるものは、標準出力に出力されるわけです。
この標準出力の内容をプログラムで取り込んで、使いたいというわけです。
#include <stdio.h>
FILE *popen(const char *command, const char *type);
int pclose(FILE *stream);
を使用することでこれが実現できます。
|
|