diff --git a/ProgUit Lab1/Answers.txt b/ProgUit Lab1/Answers.txt index 5ccc09b..f9a7364 100644 --- a/ProgUit Lab1/Answers.txt +++ b/ProgUit Lab1/Answers.txt @@ -2,4 +2,46 @@ // "ProgUit Lab1.exe" -x --y /z w 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" 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 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" NUL +Enter number count: +Enter numbers: +Enter bin count: \ No newline at end of file diff --git a/ProgUit Lab1/ProgUit Lab1.cpp b/ProgUit Lab1/ProgUit Lab1.cpp index 021cff1..fc0ae98 100644 --- a/ProgUit Lab1/ProgUit Lab1.cpp +++ b/ProgUit Lab1/ProgUit Lab1.cpp @@ -62,16 +62,38 @@ input_data(istream& hin, bool promt = false) { int main(int argc, char* argv[]) { - if (argc > 1) { - cout << "argv[0] = " << argv[0]; + + + curl_global_init(CURL_GLOBAL_ALL); + CURL* curl = curl_easy_init(); + + + + + if (argc > 1) { + 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); + else { + + } + + string promt; bool promt1 = true; + + + cout << "DO YOU NEED CERR? (YES/NO)" << endl; //while (true) { @@ -95,7 +117,8 @@ int main(int argc, char* argv[]) show_histogram_svg(bins); // Вывод графика - + curl_easy_cleanup(curl); + // Рћ diff --git a/x64/Debug/ProgUit Lab1.pdb b/x64/Debug/ProgUit Lab1.pdb index e348135..ed9e911 100644 Binary files a/x64/Debug/ProgUit Lab1.pdb and b/x64/Debug/ProgUit Lab1.pdb differ