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}} |
||
⚫ | |||
(The command <tt>ls</tt> may not exist on some system) |
|||
<lang c> |
|||
⚫ | |||
int main() |
int main() |
||
{ |
{ |
||
system("ls"); |
system("ls"); |
||
} |
}</lang> |
||
</lang> |
|||
=={{header|C++}}== |
=={{header|C++}}== |