diff --git a/main.cpp b/main.cpp index e1a8956..107ea89 100644 --- a/main.cpp +++ b/main.cpp @@ -7,7 +7,8 @@ using namespace std; -struct Input { +struct Input +{ vector numbers; size_t bin_count{}; size_t number_count{}; @@ -15,20 +16,24 @@ struct Input { }; Input -input_data(istream& stream, bool prompt) { +input_data(istream& stream, bool prompt) +{ size_t number_count; - if (prompt) { - cerr << "Enter number count: "; + if (prompt) + { + cerr << "Enter number count: "; } stream >> number_count; Input in; - if (prompt) { - cerr << "Enter bin count: "; + if (prompt) + { + cerr << "Enter bin count: "; } stream >> in.bin_count; vector numbers(in.number_count); in.numbers.resize(in.number_count); - for (size_t i = 0; i < in.number_count; i++) { + for (size_t i = 0; i < in.number_count; i++) + { stream >> in.numbers[i]; } size_t bin_count; @@ -39,14 +44,19 @@ input_data(istream& stream, bool prompt) { -int main(int argc, char* argv[]){ +int main(int argc, char* argv[]) +{ - if (argc > 1){ - auto i = 0; - while (i < argc){ - cerr << "arg[" << i << "] = " << argv[i] << endl; - i++; - } + 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);