機能 |
コマンドを実行する。 |
||
---|---|---|---|
定義 |
#include <stdlib.h> int system( const char * string ); |
||
引数 |
|
||
戻り値 |
処理系定義の値を返す。 引数にNULLを指定した場合は、コマンドプロセッサが使用可能であるときに0以外を返す。 |
||
実装例 |
#include <stdlib.h> #include <stdio.h> int main(void) { if (0 != system(NULL)) { printf("Command Procesor exists.\n"); /* Windowsバージョンの表示コマンドを実行 */ system("ver"); } return 0; } |
||
実行結果 |
Command Procesor exists. Microsoft Windows [Version 6.1.7601] |
system()