From e45343aa234771f32f068985b5601a41080d5b60 Mon Sep 17 00:00:00 2001 From: Mihail Date: Wed, 22 May 2024 14:55:22 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0?= =?UTF-8?q?=D0=BD=20curl=5Feasy=5Finit()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index c4b93de..fea912c 100644 --- a/main.cpp +++ b/main.cpp @@ -45,14 +45,15 @@ input_data(istream& stream, bool prompt) { int main(int argc, char* argv[]) { if (argc > 1) { - auto i = 0; - while (i < argc){ - cerr << "arg[" << i << "] = " << argv[i] << endl; - i++; - } - return 0; + 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_global_init(CURL_GLOBAL_ALL); + // curl_global_init(CURL_GLOBAL_ALL); bool prompt = true; auto in = input_data(cin, prompt); vector bins = make_histogram(in.numbers, in.bin_count, in.number_count, in.max_count);