From 1ba3aef39da020ce2c65cddb63395f0f4a6608d0 Mon Sep 17 00:00:00 2001 From: BushmanovAS Date: Mon, 27 May 2024 09:17:50 +0300 Subject: [PATCH] code: curl easy init --- main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index dc03428..8c47da2 100644 --- a/main.cpp +++ b/main.cpp @@ -34,12 +34,15 @@ Input input_data(istream& in, bool prompt = true) int main(int argc, char* argv[]) { if (argc > 1) { - for (int i = 0; i > argc; i++) { - cout << "argv[" << i << "] = " << argv[i]; + 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 show_prompts; cout << "Show prompts? (1 for yes, 0 for no): "; cin >> show_prompts;