void main ()
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.
As system function is declared in stdlib.h, it can be considered a C function. But in C++, stdlib.h is merged into the std namespace and is located in the cstdlib include in this form. So the correct answer is "both".
It is both C and C++.
<li>system : http://en.cppreference.com/w/c/program/system</li>
Both: it's defined by the standard C library, and the standard C++ library contains the C library.
In C++, you should include the C++ style header,
<cstdlib>, and refer to it as
std::system. Including C headers directly is deprecated.
It's both. C defines many functions. C++ defines many functions that are exactly the same as in C, some that are subtly different from how they are in C, and a lot of functions and classes that aren't part of C at all. Knowing that a function is part of standard C++ says nothing about whether it is part of standard C, and knowing that a function is part of standard C says little about whether it is part of standard C++.
Both c and cpp support the function system as they have support for the stdlib.h that contains the prototype of system() function.