From 40d522af3781ca8b2fb1b88d5b1996a08f1b1ae5 Mon Sep 17 00:00:00 2001 From: EfimovaLA Date: Sun, 2 Jun 2024 19:39:15 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=20=D1=81=20=D1=81=D0=B0=D0=B9=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/main.cpp b/main.cpp index 0c11a8f..c52902c 100644 --- a/main.cpp +++ b/main.cpp @@ -42,21 +42,25 @@ Input 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++; - } + curl_global_init(CURL_GLOBAL_ALL); + if (argc > 1) + { + 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); + } return 0; } - curl_global_init(CURL_GLOBAL_ALL); bool prompt = true; auto in = input_data(cin, prompt); auto bins = make_histogram(in.numbers, in.bin_count); - // show_histogram_svg_vertical(bins); + // show_histogram_svg_vertical(bins); show_histogram_svg(bins); }