Добавил проверку ошибок

master
Stepan Siniavskii 2 лет назад
Родитель d25177cf18
Сommit 3818146131

@ -38,10 +38,19 @@ input_data(istream& inn, bool promt) {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);
if (argc > 1){ if (argc > 1)
cout << argc << endl; {
for(size_t i = 0; i < argc; i++){ CURL *curl = curl_easy_init();
cout << "argv[" << i << "] = " << argv[0] << endl; if(curl)
{
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res != CURLE_OK){
cout << curl_easy_strerror;
exit(1);
}
} }
return 0; return 0;
} }

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