c++

Virtual destructor

There was a question about the virtual destructor. As far as I understand-a virtual destructor is needed so that in the inhe ... ted class, then you need to create a virtual one. And all this so that there is no memory leak. Did I get the point right?

Search for a substring in a string

How can I find the substring of the entered string in C++? For example, I entered the string: "Hello World", then I enter "ll ... let it output true. Here is something you need to create, but I do not know how to give a search in the string for a match.

C2440: Unable to convert const char* to PVOID

I am writing a joke program that will change the image of the desktop: An error occurred in one of the lines of code: System ... wears that it is impossible to convert const char* to PVOID. I think I missed something somewhere. What could be the problem?

Books on Qt

Hello! The question arose whether there are books for learning Qt, but not such as it usually happens, which tell something s ... s library. Russian Russian books are desirable, but if they are not in Russian, I don't mind reading them in English as well.

Why do I get the error `copy assignment operator is implicitly deleted`?

There is a class in which there is such a variable PoolWrapper<FrameManager> m_PoolWrapperFrameManager; Here is its ... r<FrameManager>' cannot be assigned because its copy assignment operator is implicitly deleted What am I doing wrong?

Creating a C++graphical application

I write programs for uni, I always made do with the console, and then I needed to make a program that displays the Cartesian ... est way to implement this. I think the simplest is Visual C++ and the CLR in Visual studio, but maybe there is a simpler one?

Cyclic right shift of the binary code

Good day to all! The essence of the problem is as follows: there is a certain number n and its binary preposition, after a ce ... cout << mx << endl; } return 0; } But I get the following error Please help me solve the problem

Deleting an array element by index

Very simple, but it doesn't work. #include <cstdlib> #include <iostream> #include <math.h> using namespace ... lt;< "\n"; system("PAUSE"); return EXIT_SUCCESS; } You need to delete an array element from this array by index.

How to do it correctly подключать.срр modules?

There is a file core.cpp with some functions. How do I properly connect core.cpp to my project? In addition, both core.cpp an ... n module of the project contain the directive #include <windows.h>. Will this not lead to a conflict in the conclusion?

How to write commits correctly?

There is a project for quite a lot of files (. cpp and .h project in C++). In general, I decided to use git. I filled in the ... re project on git, do I need to commit each file? That is, to sit and describe each file? And how to write commits correctly?

How many ways are there to pass arguments to a function?

As for me, in C there is a transfer of arguments to a function only by value, and in C++ in fact, too, only a transfer by val ... ameters are simply initialized somewhere between the signature and the body in the scope under which the function body falls.

It is not possible to call the method from c++ via the java native interface, an exception is raised

#include "pch.h" FARPROC loadDll(LPCWSTR dllname, LPCSTR procName) { setlocale(LC_ALL, "Rus"); HMODULE dll = Lo ... ID method=env->GetMethodID(cls, "println",("Ljava/lang/String;)V"); cout << "" << endl; return 0; }

Neural network in C++ multiplication of matrices of different sizes

There was a problem I want to write a simple neural network in C++, but I ran into one problem, I need to multiply the mat ... "output: " + str(output)) return activation_function(output) == 1 print("result:" + str(predict(vodka, rain, friend)))

How to pass a function as a parameter in C++?

How do I declare all this and then get the return value?

Checking for an empty character in an affine cipher

I implement an affine cipher. It is necessary that the words can be entered only without a space. But it is not possible to i ... out << "Расшифрованное сообщение: " << decryption(c) << endl; } _getch(); return 0; }

Method inheritance in C++

I want to implement the Vector class as an entity of a linear space, and then inherit the usual DoubleVector and Matrix from ... peration is not defined, so the code will drop. Question: is it possible to solve this problem without rewriting the methods?

Pointer reference vs pointer to pointer. C++

Is there any difference in performance, or are there any Pros and Cons to using such a design at all: Type* a = new Type(); ... be stored / processed roughly as a reference to at a lower level? I will be grateful for your explanations in this matter.

Why std::find returns a pointer?

Why the find() method uses a pointer. That is, in this example #include <iostream> // std::cout #include <algori ... ay. We just need to search for it in the array and that's it. Why can't this be done without a pointer? Thank you in advance!

C++ Inheritance, Encapsulation, Templates

Is there a way in C++ to restrict access to certain class functions when writing code? So that in some IDE, in one case, the ... y f1 be open? So that f2 and f3 are not displayed in the tooltip. Perhaps there is a way to solve it without using templates?

Is there a difference between GCC (g++) and Visual Studio?

I have a couple of questions from a beginner. If a program compiles correctly in VS, will it compile correctly in g++(GCC) ... s 10, will it compile correctly on Linux? Is it possible to check whether the program will compile in Linux and in g++(GCC)?