code: загрузка файла по сети и обработка ошибок

main
SneguraDS 12 месяцев назад
Родитель 7e88ff33cd
Сommit 3becba6c29

@ -50,11 +50,23 @@ int main(int argc, char* argv[])
{
if (argc>1){
for (size_t i=0; i<argc; i++){
cout<<argv[i]<<endl;
CURL* curl = curl_easy_init();
if(curl) {
CURLcode res;
const char* res2;
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
res = curl_easy_perform(curl);
if (res!=0){
res2=curl_easy_strerror(res);
cout<<res2<<endl;
exit(1);
}
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, in.number_count, in.max_count);

Загрузка…
Отмена
Сохранить