请问system()函数属于C或C ++? [英] Does the system() function belong to C or C++?

查看:146
本文介绍了请问system()函数属于C或C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include <stdio.h>
#include <stdlib.h>
void main ()
{
   system("dir");
}

我许多C ++的书读过其中系统()是用来执行命令行程序。但是,当我用C尝试相同的命令,它的工作完美。所以我的问题是,是否它是一个标准的C或C ++函数?因为我是新来的C编程请宽松。

I have read in many C++ books where system() is used to execute command line programs. But when I tried the same command in C, it worked perfectly. So my question is whether its a standard C or C++ function? Please be liberal as I am new to C programming.

推荐答案

C和CPP支持该功能的系统,因为他们有一个包含系统的原型stdlib.h中支持()函数。

Both c and cpp support the function system as they have support for the stdlib.h that contains the prototype of system() function.

这篇关于请问system()函数属于C或C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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