code: curl example
Этот коммит содержится в:
@@ -2,4 +2,46 @@
|
|||||||
|
|
||||||
// "ProgUit Lab1.exe" -x --y /z w
|
// "ProgUit Lab1.exe" -x --y /z w
|
||||||
argv[0] = ProgUit Lab1.exe
|
argv[0] = ProgUit Lab1.exe
|
||||||
|
Êàê è ñêàçàíî â ðàáîòå: íàçâàíèå ïðîãðàììû
|
||||||
|
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" param "with spaces"
|
||||||
|
argv[0] = ProgUit Lab1.exe
|
||||||
|
// Íåò âûâûâîäà â cerr, çíà÷èò íàçâàíèå ïðîãðàììû
|
||||||
|
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" <marks.txt >NUL
|
||||||
|
Enter number count:
|
||||||
|
Enter numbers:
|
||||||
|
Enter bin count:
|
||||||
|
|
||||||
|
// Âñå óøëî â NUL, òî åñòü ýòîãî áîëüøå íåò
|
||||||
|
..Åñëè ïîäñòàâèòü ôàéë: òî òàì áóäåò êîä ïî ðåçóëüòàòàì âûïîëíåíèÿ èç marks.txt
|
||||||
|
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" param <marks.txt >NUL
|
||||||
|
//  ýòîì ñëó÷àå â NUL óéäåò argv[0] = ProgUit Lab1.exe
|
||||||
|
Êàê è ñêàçàíî â îïèñàíèè ðàáîòû ïåðâûé ýëåìåíò[0] ðàâåí íàçâàíèþ ïðîãðàììû
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" param "with spaces"
|
||||||
|
argv[0] = ProgUit Lab1.exe
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" -x --y /z w
|
||||||
|
argv[0] = ProgUit Lab1.exe
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" -x --y /z w
|
||||||
|
argc = 5
|
||||||
|
argv[0] = ProgUit Lab1.exe
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" param "with spaces"
|
||||||
|
argc = 3
|
||||||
|
argv[0] = ProgUit Lab1.exe
|
||||||
|
C:\Users\user\source\repos\ProgUit Lab1\x64\Debug>"ProgUit Lab1.exe" <marks.txt >NUL
|
||||||
|
Enter number count:
|
||||||
|
Enter numbers:
|
||||||
|
Enter bin count:
|
||||||
@@ -62,16 +62,38 @@ input_data(istream& hin, bool promt = false) {
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
CURL* curl = curl_easy_init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
cout << "argv[0] = " << argv[0];
|
if (curl) {
|
||||||
|
CURLcode res;
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
string promt;
|
string promt;
|
||||||
bool promt1 = true;
|
bool promt1 = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cout << "DO YOU NEED CERR? (YES/NO)" << endl;
|
cout << "DO YOU NEED CERR? (YES/NO)" << endl;
|
||||||
|
|
||||||
//while (true) {
|
//while (true) {
|
||||||
@@ -95,6 +117,7 @@ int main(int argc, char* argv[])
|
|||||||
show_histogram_svg(bins); // Вывод графика
|
show_histogram_svg(bins); // Вывод графика
|
||||||
|
|
||||||
|
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Двоичные данные
x64/Debug/ProgUit Lab1.pdb
Двоичные данные
x64/Debug/ProgUit Lab1.pdb
Двоичный файл не отображается.
Ссылка в новой задаче
Block a user