code: загрузка файла по сети
Этот коммит содержится в:
32
main.cpp
32
main.cpp
@@ -7,7 +7,8 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
struct Input {
|
||||
struct Input
|
||||
{
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
size_t number_count{};
|
||||
@@ -15,20 +16,24 @@ struct Input {
|
||||
};
|
||||
|
||||
Input
|
||||
input_data(istream& stream, bool prompt) {
|
||||
input_data(istream& stream, bool prompt)
|
||||
{
|
||||
size_t number_count;
|
||||
if (prompt) {
|
||||
if (prompt)
|
||||
{
|
||||
cerr << "Enter number count: ";
|
||||
}
|
||||
stream >> number_count;
|
||||
Input in;
|
||||
if (prompt) {
|
||||
if (prompt)
|
||||
{
|
||||
cerr << "Enter bin count: ";
|
||||
}
|
||||
stream >> in.bin_count;
|
||||
vector<double> numbers(in.number_count);
|
||||
in.numbers.resize(in.number_count);
|
||||
for (size_t i = 0; i < in.number_count; i++) {
|
||||
for (size_t i = 0; i < in.number_count; i++)
|
||||
{
|
||||
stream >> in.numbers[i];
|
||||
}
|
||||
size_t bin_count;
|
||||
@@ -39,13 +44,18 @@ input_data(istream& stream, bool prompt) {
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[]){
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
if (argc > 1){
|
||||
auto i = 0;
|
||||
while (i < argc){
|
||||
cerr << "arg[" << i << "] = " << argv[i] << endl;
|
||||
i++;
|
||||
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;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user