code: добавил curl_easy_init()
Этот коммит содержится в:
11
lab_4.cbp
11
lab_4.cbp
@@ -13,7 +13,12 @@
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
<Add directory="curl/include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libcurl.dll.a" />
|
||||
<Add directory="curl/lib" />
|
||||
</Linker>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/lab_4" prefix_auto="1" extension_auto="1" />
|
||||
@@ -32,7 +37,13 @@
|
||||
<Add option="-Wall" />
|
||||
<Add option="-fexceptions" />
|
||||
</Compiler>
|
||||
<Unit filename="histogram.cpp" />
|
||||
<Unit filename="histogram.h" />
|
||||
<Unit filename="main.cpp" />
|
||||
<Unit filename="sr.cpp" />
|
||||
<Unit filename="sr.h" />
|
||||
<Unit filename="svg.cpp" />
|
||||
<Unit filename="svg.h" />
|
||||
<Extensions>
|
||||
<lib_finder disable_auto="1" />
|
||||
</Extensions>
|
||||
|
||||
15
main.cpp
15
main.cpp
@@ -36,8 +36,21 @@ input_data(istream& in, bool prompt)
|
||||
return ik;
|
||||
}
|
||||
|
||||
int main()
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
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);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
auto in = input_data(cin, true);
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
|
||||
Ссылка в новой задаче
Block a user