From 62efa8240e6efac3f7e44a5ab2e2706e9d4f4abc Mon Sep 17 00:00:00 2001 From: FilippovDY Date: Mon, 3 Jun 2024 12:26:18 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=9A=D0=BE=D0=BD=D0=B5=D1=87=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 24f0265..8bce6f8 100644 --- a/main.cpp +++ b/main.cpp @@ -21,17 +21,18 @@ Input input_data(istream& stream, bool prompt) { size_t number_count; - if (prompt) + if (prompt==true) { cerr << "Enter number count: "; } stream >> number_count; Input in; - if (prompt) + if (prompt==true) { cerr << "Enter bin count: "; } stream >> in.bin_count; + vector numbers(in.number_count); in.numbers.resize(in.number_count); for (size_t i = 0; i < in.number_count; i++) @@ -64,15 +65,21 @@ Input download(const string& address) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); res = curl_easy_perform(curl); - if (res != CURLE_OK) + curl_easy_cleanup(curl); + if (res != 0) { - curl_easy_strerror(res); + cout << res; exit(1); } - curl_easy_cleanup(curl); + curl_version_info_data *curl_info = curl_version_info(CURLVERSION_NOW); + for (size_t i = 0; curl_info->protocols != NULL; i++){ + cerr << curl_info->protocols[i] << "\n"; } + curl_global_init(CURL_GLOBAL_ALL); return input_data(buffer, false); } +} + int main(int argc, char* argv[]){ Input in;