From 7aea419533083f4281d6ff3d36111bf87bacdf9d Mon Sep 17 00:00:00 2001 From: KnyazevSK Date: Sun, 4 Jun 2023 18:59:19 +0400 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20curl=5Feasy=5Finit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/project/main.cpp b/project/main.cpp index e8b81d7..b333ac6 100644 --- a/project/main.cpp +++ b/project/main.cpp @@ -35,8 +35,20 @@ input_data(istream& in, bool prompt) -int main() +int main(int argc, char* argv[]) { + 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); auto in = input_data(cin, true); auto bins = make_histogram(in.numbers, in.bin_count);