From 91ac607708601ed52136c7d20e70b63fcb39d150 Mon Sep 17 00:00:00 2001 From: "Alice (SemenovIA)" Date: Mon, 28 Oct 2024 03:57:28 +0300 Subject: [PATCH] code: curl_easy_init() --- project/main.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/project/main.cpp b/project/main.cpp index 003d5bb..af13205 100644 --- a/project/main.cpp +++ b/project/main.cpp @@ -45,15 +45,16 @@ 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);