Execute a system command: Difference between revisions

Content added Content deleted
(→‎{{header|C}}: this C code compiles on every machine having a reasonable C compiler, and system is POSIX compliant)
m (→‎{{header|C}}: stripped unuseful text (because of the task specification))
Line 25: Line 25:
{{works with|POSIX|.1-2001}}
{{works with|POSIX|.1-2001}}


<lang c> #include <stdlib.h>
(The command <tt>ls</tt> may not exist on some system)

<lang c>
#include <stdlib.h>
int main()
int main()
{
{
system("ls");
system("ls");
}
}</lang>
</lang>


=={{header|C++}}==
=={{header|C++}}==