Help Please with "wget".

This is what I need to do:

Write a program which asks the user for the URL of a text file, checks to see if the URL starts with "http://", and downloads the file and prints it on the screen. Use the wget system command; for example, the statement

" -O webfile.txt");

gets a text file from the web and saves it as webfile.txt in the current
directory. Your program would then open webfile.txt and print it on the

This is my code so far:

#include <iostream>
#include <string>
int system(const char *command);

int main()

std::string website;
std::cout<<"Enter a website that you want to grab: ";
std::string command="wget "+website;
system((const char*)command.c_str());


I honestly don't know what I need to do from here. Any help would be appreciated. Thanks.
To use system() you need to #include <cstdlib> .
Topic archived. No new replies allowed.