0

It is my first time with Linux, and I need to use this

execlp("/usr/bin/wget", "wget", <URL STRING1>, NULL) system call in C++ code,

I cannot find anywhere how it should be written in C++, need some help.

Thank you!

4

2 回答 2

1
execl("/usr/bin/wget","wget","http://stackoverflow.com/",NULL);

should do the job.

于 2012-09-18T02:57:56.390 回答
1

包括unistd.h

#include <unistd.h> 

int main() {
    execlp("/usr/bin/wget", "wget", "http://www.google.com", NULL);

    return 0;
}
于 2012-09-18T03:05:38.083 回答