c++

VS2019 step-by-step debugging skips loop iterations

Created a simple code with a loop on Visual Studio 2019: #include <iostream> using namespace std; int main() { i ... with no gaps like the one described? P.S. F9 does not help, it goes into the instruction itself, as, in fact, it should be.

Convert std:: string to std:: wstring

How do I translate std::string to std::wstring? Admit: std::string s = "some string"; std::wstring ws = f(s); How can f() be implemented?

Reading the file line by line

You need to open the file and read it line by line, that is, take the first line, put it in a variable, do certain operations with it, then take the second, etc.

How to declare a function pointer in C / C++

How to declare a function pointer in C / C++

Quick sort in C++

Give an example of a quick sort algorithm in C++.

Merge sorting in C++

Give an example of merge sorting in C++.

How to create an array of function pointers in C / C++

How to create an array of function pointers in C / C++

Please find the error. If possible, complete the task

A square matrix is given. If in the i-th row of the matrix the element belonging to the main diagonal is negative, then repla ... cout << A[i][j] << "\t"; cout << "\n"; } } system("pause"); return 0; }

Lock-free ordered list

There is a method for inserting an item into an ordered list. Will it be correct for lock-free? template< typename _Pred & ... ck. P. s.: strange all the same regulations on the Hash Code about comments, why can't you control their number individually?

the product of the C++Fibonacci numbers

You need to recursively calculate the product of the Fibonacci numbers from 1 to N in theory, everything is normal, but in pr ... urn 1; else return fibproduct(fib(m-1)) * (fib(m)); } int main(void) { cout << fibproduct(4); return 0; }

Function overloading and templates in C++

In pursuit of the question of function overloading: C++ Using function overloading, write a program for calculating the prod ... ade function overloading unnecessary (in C++)? Or are there still options where templates can't replace function overloading?

Initializing a two-dimensional dynamic array

I am trying to initialize all the elements of a two-dimensional array when declaring it: int** ints = new int* [n] { new int ... lays -842150451 -842150451 -842150451 -842150451 -842150451 , and such: int* ints = new int[5] { 0 }; - 0 0 0 0 0 .

Memory fragmentation

As you know, the garbage collector in C# (more precisely, in the CLR) cleans up RAM from time to time, freeing up memory occu ... te a new object, but the object cannot be created. Is it true? There is a feeling that I am wrong in my reasoning, but where?

What is the meaning of the warning "C4996: '...': This function or variable may be unsafe"?

I use Microsoft Visual Studio, and it gives a warning C4996, for example: warning C4996: 'fopen': This function or variable ... name for this item is deprecated. Instead, use the ISO C++ conformant name: _chsize. What the hell and how to deal with it?

STL C++Iterators

Hello! Please tell me if it is possible to store iterators from vector for a long time, for example, so that it can be derefe ... о листинга cout << *b[*it] << endl; } Instead of char*, the program with the error has a different structure.

C++ passing a lambda return value to a function

There is a function that simply outputs numbers from a vector. void test(std::vector<int> vec) { for(int item: vec ... ‘main()::’ to ‘std::vector I understand that as an argument the lambda itself is passed, but how to pass what it returns?

Code highlighting in Visual studio 2017 works intermittently for #defines written in the included files

I write a program in C++ using WinSock2. This library contains a number of constants and macros created with #define. While w ... ght. Even if all constants and macros are underlined in red, the project is built without problems and it works as it should.

Bubble sorting in C++

Give an example of bubble sorting in C++.

Virtual inheritance in C++

What is it and why is it used in C++?

What is an abstract class in C++?

What is an abstract class in C++?