Jose Velasquez

Generation

generate functionSun, 18 Jun 2023

programa que haga un ping y diga hola si el pin funciona

#include <iostream> #include <string> #include <curl/curl.h> using namespace std; int main() { cout << "Hola Rodrigo!" << endl; string url = "http://www.google.com"; CURL* curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); CURLcode res = curl_easy_perform(curl); if (res == CURLE_OK) { cout << "Ping funciona!" << endl; } else { cout << "Ping no funciona!" << endl; } } cout << "Saliendo del programa..." << endl; return 0; }

Questions about programming?Chat with your personal AI assistant