c++

How to use QT & Code::Blocks together?

Guys, I just started programming in C++. Here I want to try it together with Qt, but how to use it together with your favorite Codeblocks I do not know, tell me how?

How do I open a form designer in a Windows Application C++project?

Hello everyone. In general, I created a Windows Application C++project. When running without errors, a beautiful form is created. But the problem is-there is no designer, how do I create buttons, labels, etc? Screen:

Hiding names with type alias

Example: struct A {}; struct B { using A = A; }; int main() { B b; } Clang compiles this. GCC throws an error (exampl ... he completed scope of S. No diagnostic is required for a violation of this rule It turns out that GCC - incorrect behavior?

Parsing XML with MSXML

I haven't coded in C++ for a long time and I've already forgotten a lot. I use Visual Studio 2019. Trying to create an XML d ... rent>"); spXMLDoc.Release(); CoUninitialize(); } But in run-time throws an exception: What am I doing wrong?

Interactive number guessing challenge. C++

Task condition : This is an interactive task. The jury program guesses an integer N (1 ≤ N ≤ 10^9), which your program will ... The program does not pass in time. So it's "stuck" somewhere? But where? And why? In theory, everything should work fine...

Step-by-step graph traversal

A step-by-step traversal of a graph from vertex v is a sequence of vertices u1, u2,..., ur such that: U1 = ur = v, Every ver ... cout << i << " "; } } The testing system returned an error on the third test. Please help me fix the code.

The LPVOID type and how to use it (C++)

Hello. Recently I started working with data channels, well, those that are NamedPipe. The functions of writing and reading ... e, which is declared via new char (the compiler skips, but error 998 occurs when reading Invalid access to memory location.)

Character comparison by the strcmp function()

There is a certain function: void slovo(char *stroka) { ... if( strcmp(stroka[i]," ")!=0) ... } When compiling, the compiler ... meter 1 from 'char' to 'const char *' I don't know what's wrong... I need to compare a character from an array with a space.

Exit the loop by pressing ESC

I want to exit the loop by pressing the ESC key. I try to exit the loop as written here: How to read until ESC button is pres ... lt;< "Нет такой сортировки\n\n"; break;} } } But it doesn't work. How can I make the loop exit work by pressing ESC?

How to work with MySQL in C++

I can't figure out how to work with MySQL queries in C++. I'm trying to write a console program that will record customer dat ... ведите имя клиента: "; getline(cin, fullName); cout << "Введите ID абонемента: "; cin >> ID_abon; }

Error copying the QFile file in Windows

I create a file, write text to it, then I want to copy it. But the copy function returns false. As a directory to copy in the ... fore closing it and after. Always the answer is false. P. S. S. key_file.errorString(); outputs in both cases: Unknown error.

Deleting a binary tree in C++

Help find the memory leak in the following binary tree implementation. Maybe someone is too lazy to dig into such a piece of ... (5); tree->Add(4); tree->Add(2); tree->View(); delete tree; } Thank you, if anyone is too lazy to dig into this

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; }

ACMP Sorting by Choice

In this task, you are asked to implement selection sorting. An array of integers a0, a1, ..., an-1 is given. Let's sort it ... b[i]= imax; swap(a[i], a[j]); } for (int i = 0; i < n; i++) cout << b[i] << " ";

Request to the IBM Watson translate API using Boost:: Asio

There is a template for accessing the IBM Translator API in curl $ curl -X POST --user "apikey:{apikey}" \ --header "Content- ... s raised at 0x0F93B144 (libssl-1_1.dll) in ConsoleApplication3.exe: 0xC0000005: read access violation at address 0x0000009C.

C / Recursive calculation of arctg(x)

You need to calculate arctg x using a recursive function and a continued fraction: With an accuracy of 0.000001. I do this: ... stem("pause"); return 0; } But I get thrown an exception about stack overflow. How to fix it and what exactly is wrong?

Program for writing a class of complex numbers

using namespace std; class Complex // класс "Комплексное число" { private: double re, im; // действительная и ... o we use const in the overload, what does a pointer to c mean? What is it with? Please explain the highlighted code sections.

the incidence matrix to the adjacency matrix of an edge graph

It is necessary to transform the edge graph from the incidence matrix to the adjacency matrix. for those who do not understan ... < endl; } cout << endl; //end _getch(); }

Visual C++: Random number generation (rand)

How to generate numbers from the range from 256 to 2048 in increments of 64?

How do modules from c++20 work?

I decided to see what changes were introduced in the 20th standard, and one of the first changes put me in a dead end: module ... ent file and start processing the others until the desired module is encountered? How do modules affect compiler performance?