From 12ed6c524c536d8c2bb8de3eba92bcfb1c85ff29 Mon Sep 17 00:00:00 2001 From: LykovaYA Date: Thu, 21 Nov 2024 21:45:43 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20curl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab34.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lab34.cpp b/lab34.cpp index aed2b30..6866822 100644 --- a/lab34.cpp +++ b/lab34.cpp @@ -30,11 +30,16 @@ input_data(istream& inn, bool promt) { return in; } -int main(int argc, char* argv[]) { +int main(int argc, char* argv[]) { if (argc > 1) { - for (int i = 0; i < argc; i++) { - cout << "argv [" << i << "] = " << argv[0] << endl; + CURL* curl = curl_easy_init(); + if (curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, argv[1]); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); } + curl_easy_cleanup(curl); return 0; } curl_global_init(CURL_GLOBAL_ALL);