0

for ループ内に curl リクエストがあり、指定された string` がない場合にのみ、curl からの結果を出力したいと考えています。

            curl_global_init(CURL_GLOBAL_ALL);
            curl = curl_easy_init();
            if(curl) {
              curl_easy_setopt(curl, CURLOPT_URL, "LOCALHOST:8080/questions.php");
              snprintf(postdata, sizeof postdata, "1=%s&2=%s&3=%s&4=%s&5=%s",
                 list[a],list[b],list[c],list[d],list[e]);
              curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postdata);
              res = curl_easy_perform(curl);
              if(res != CURLE_OK)
                fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));
              curl_easy_cleanup(curl);
            }
4

0 に答える 0