From 1b9098ef20992640c6b65f29e8143d304ee02718 Mon Sep 17 00:00:00 2001 From: MelnikovDM Date: Mon, 27 May 2024 08:33:29 +0300 Subject: [PATCH] code: curl_easy_init --- labor01.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/labor01.cpp b/labor01.cpp index 18d0954..3834d06 100644 --- a/labor01.cpp +++ b/labor01.cpp @@ -42,14 +42,17 @@ input_data(istream& inn, bool promt) { -int main(int argc, char* argv[]) { +int main(int argc, char* argv[1]) { if (argc > 1) { - cout << argc << "\n"; - for (int i = 0; i < argc; i++) { - cout << "argv[" << i << "] = " << argv[i] << "\n"; + 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 promt = true; auto in = input_data(cin, promt); auto bins = make_histogram(in.numbers, in.bin_count);