C/Development/System Command — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 13:22, 25 мая 2010
Call system command: dir
<source lang="cpp">
- include <stdlib.h>
int main(void) {
return system("dir");
}
</source>
Execute system command: dir, copy and so on
<source lang="cpp">
- include <stdio.h>
- include <stdlib.h>
int main () {
int res; puts ("Trying to execute command DIR"); res = system ("dir"); if (res == -1) puts ("Error executing DIR"); else puts ("Command successfully executed"); return 0;
}
</source>