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

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

@ -38,11 +38,20 @@ input_data(istream& inn, bool promt) {
int main(int argc, char* argv[]) {
curl_global_init(CURL_GLOBAL_ALL);
if (argc > 1){
cout << argc << endl;
for(size_t i = 0; i < argc; i++){
cout << "argv[" << i << "] = " << argv[0] << endl;
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);
if (res != CURLE_OK){
cout << curl_easy_strerror;
exit(1);
}
}
return 0;
}
auto in = input_data(cin, true);

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