c++14

The Euler function. time-limit-exceeded

The program implements the Euler function (https://ru.wikipedia.org/wiki/Функция_Эйлера), everything seems to work, I checked ... | n<0 || n<k) throw invalid_argument("Binom condition failed"); cout << Euler(k,n); return 0; }

How do I get the new C++20 standard?

I write in c++ in visual studio 2017, quite recently I realized that I have a very old c++98 standard, but how so? I seem to ... stream> int main() { std::cout << __cplusplus; return 0; } I collect this code and get this on the output:

How do I pass a function template to another function?

How to write the function test correctly, so that it can pass any of the functions f and g as an argument (or a template para ... ^ prog.cpp: In function 'int main()': prog.cpp:26:8: error: 'test' was not declared in this scope test(f); ^

Variable templates in C++14

While studying the new C++ standard, I came across the innovation " variable templates" The syntax of the template is as fol ... by with a non-template, because we specify the value explicitly, respectively, and we can write (output) the type explicitly.

How does std:: unique lock differ from std:: lock guard?

How does std::unique_lock differ from std:: lock_guard? In which situations is it better to use one class, and in which another?

Listing structure fields

There is a structure and functions: struct S { T1 t1; T2 t2; // и т.д. } s; template <class T> f(const T& ... You can't use third-party libraries, but you can use macros, templates, and generally all the available features of C++14.

How many in the interval [a; b] are the numbers that are divisible by 7 without remainder

Write a program that reads numbers a, b (100 <a, b <10000) from the input data and determines how many in the interval ... ++i) { if (i % 7 ==0) { i++; cout << sum << ' '; } } return 0; }

c++: allocating space for a container

Please tell me, if I have a container and I know how many elements there will be in it, to speed up the work, I can select th ... lear(); Do I need to reserve the volume again, or is it possible to make such a clear() so that the reserved memory remains

C++ 14 constexpr std::array

I'm studying constexpr. I can't understand why the compiler doesn't treat one of the expressions as a constant, because it fi ... 't I know why it doesn't work. I am interested in the gcc 5.4.0 and gcc 6.4.0 compilers. clang does not compile this either.

C++/ AVR. The new[](unsignet int) operator is not defined

I write a program for ATmega328P in C++. When compiling, an error occurs - undefined reference to operator new[](unsigned int ... ontrollerTest-atmega328p.elf.dir/all' failed mingw32-make.exe: *** [all] Error 2 Makefile:82: recipe for target 'all' failed

I am having a problem with Dev C++ in displaying members of a class

To be more exact, when I squeeze "."after some object, type I declare a Vector: vector<int>Random; So far everythin ... l a function and the compiler does not show the arguments that go into the function, who uses dev c++ knows what I'm talking.

Problem with condition no While in C++

Hello, I am studying from Bjarne's book "PROGRAMMING Principles and practice Using C++". I'm trying to do drill number 1 of C ... cin >> n >> n1; system("cls"); cout << n << " " << n1 << "\n"; } }

Segmentation fault error (core dumped)

Good morning, everyone, how are you? I have a problem to solve in C++Language: " encode, in C, a vector addition program. ... o que é o objetivo do trabalho) // Compilar Programa: gcc nome_ficheiro.c -o nome_output // Executar Programa: ./nome_output