From beeb53983e91814e832db44b043a6f898fa3c555 Mon Sep 17 00:00:00 2001 From: Hihoffff Date: Wed, 4 Jun 2025 13:52:07 +0300 Subject: [PATCH] code:curlWriteFromLink --- Lab1.cbp | 5 +++++ main.cpp | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Lab1.cbp b/Lab1.cbp index 2c87010..cfe3e9b 100644 --- a/Lab1.cbp +++ b/Lab1.cbp @@ -14,9 +14,12 @@ + + + @@ -39,6 +42,8 @@ + + diff --git a/main.cpp b/main.cpp index 8deca7a..349d59f 100644 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,6 @@ using namespace std; #include "svg.h" -//313 struct Input { std::vector numbers; size_t bin_count{}; @@ -14,9 +13,24 @@ struct Input { Input input_data(istream& in, bool promt); -int main() +int main(int argc, char* argv[]) { - curl_global_init(CURL_GLOBAL_ALL); + if(argc > 1 ){ + curl_global_init(CURL_GLOBAL_ALL); + 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; + } + + Input in = input_data(cin,true); std::vector bins = make_histogram(in.numbers, in.bin_count);