Sunday, December 1, 2013

C exercise: run host command with system()

To run host command in C program, call system() of stdlib.

run host command with system()
run host command with system()

#include <stdio.h>
#include <stdlib.h>

int main(){
 system("df -h");
 return 0;
}


Related:
- Run host command and get result with popen()

No comments: