Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unistd.h>
- int main(int argc, char *argv[])
- {
- FILE *in;
- char buff[512];
- in = popen("ping -cokcglf 2>&1", "r");
- while(fgets(buff, sizeof(buff), in)!=NULL){
- std::cout<<buff;
- }
- auto err = pclose(in);
- std::cerr<< WEXITSTATUS(err);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement