这是我的代码:
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <stdio.h>
#include <curl/curl.h>
using namespace std;
int main ()
{
ifstream llfile;
llfile.open("C:/log.txt");
if(!llfile.is_open()){
exit(EXIT_FAILURE);
}
string word;
llfile >> word;
llfile.close();
string url = "http://example/auth.php?ll=" + word;
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
这是我编译时的错误:
main.cpp|29|warning: 不能通过非 POD 类型的
'struct std::string'
对象'...'
;调用将在运行时中止