code: обработка ошибок

master
Andrew (ShabatovAA) 11 месяцев назад
Родитель 713e2afbab
Сommit 9e5a40833f

@ -52,8 +52,12 @@ int main(int argc, char* argv[])
CURL* curl = curl_easy_init(); CURL* curl = curl_easy_init();
if(curl) { if(curl) {
CURLcode res; CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://uit.mpei.ru/study/courses/cs/lab03/marks.txt"); curl_easy_setopt(curl, CURLOPT_URL, "//uit.mpei.ru/study/courses/cs/lab03/marks.txt");
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
if (res != '0'){
cout << curl_easy_strerror(res);
exit(1);
}
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
} }
return 0; return 0;

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