-
Similar to Zhihu, how is the matching architecture designed?
each person starts the game with a different Rank (a total of 14 Rank) and selects two people to answer the question pk,. How to design this algorithm?
suppose that after I click to start the game, I send my request to enter a game to the server, and ...
-
How does the equal sign work in C language?
unsigned char CPM 1;
-1 is a constant stored according to the int type. C is printed directly. The last byte of the complement mode of-1 is copied directly to c. Is the equal sign of c language copied directly bit by bit? When you assign a constant to ...
-
The preorder of the binary tree traverses, do not understand what this question let me return (C language), cPP I do the opposite
binary tree preorder traversal
**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*
**
* Return an array of size *returnSize.
* Note: The returned arr...
-
Code interpretation of programming problems
pairs of positive integers (xpeny), the remainder of xrecery y is greater than or equal to k, the input is nmemery k, and the output is how many, for example, input 52, output 7, logarithms are (2magin3) (2magin4) (2mem5) (3pyrr5) (4preline 5) (5pc5), t...
-
In logical calculation, how to encounter true retention and false inversion?
for example, if there are two Boolean variables amenb, respectively, when b=true returns acentrology false, it returns! a, how to implement it with simple operation? how should I write a xxx b xxx?
is actually a question of how to: true true f...
-
What is the use of the & in the CPP overload operator argument?
-sharpinclude <iostream>
using namespace std;
class Box
{
public:
double getVolume(void)
{
return length * breadth * height;
}
void setLength(double len)
{
length = len;
}
void setBreadth(double bre)
...
-
Compile a function template program to find the maximum value in two data
1. Compile the function template program to find the maximum of the two data; 2. The source code is as follows:
test.cpp
-sharpinclude <iostream>
using namespace std;
template <class T>
T max(T m1, T m2)
{return (m1 > m2)? m1:m2;}
in...
-
Error compiling btcpool source code
downloaded the btcpool source code, want to run on ubuntu16.04, but compiled ~!
is there really a problem with the source code? Has anyone ever encountered this problem? who has the experience of successfully compiling btcpool source code?
PPPPPP...
-
Whether the regular expression is correct / ^\ _ [Amurz] {2pm 10} $/
^ _ [Amurz] {2jue 10} $ is there a problem with this regular expression? see that no one writes that on the Internet. [Amurz] is all of [a-zA-Z]....
-
CPP escapes json string
A json string variable is
{
"a": 1,
"b": 2
}
wants to escape as the json string { "a ": 1, "b ", 2}. is a variable, so there is no way to use R "() ". The json library uses jsoncpp is there any good way?
...
-
Does std::vector < std::string > require manual memory release?
in practice, we encountered the use of vector < string > as a local variable to temporarily store a large number of string, and found that a large amount of memory was not released after running. After taking a look at the related problems, it is general...
-
CPP retest questions, cin was skipped
the title is as follows: the robot walks the maze the maze consists of N W S E stepping on N, stepping on N, stepping on W, walking on the left, stepping on S, stepping on E, and stepping on E, input the number of rows in the maze is not greater than...
-
Why doesn't the line `thread [I] = thread (exec_produce, I + 1) `report an error?
void exec_produce(int duration) {
duration
this_thread::sleep_for(chrono::seconds(duration));
this_thread::get_id()id
cout << "exec_produce thread " << this_thread::get_id()
<< " has sleeped &q...
-
There is a memory leak problem when CPP uses ODBC to connect to the database.
I want to implement a function of regular reconnection after a failed database connection, but I don t know why there is a memory leak, so I d like to ask the gods. to make it easier to ask questions, I tidied up the code, connected to the database d...
-
Why do you need dynamic link libraries for dynamic linking?
for example, dynamic link libraries (.lib .so files) are not introduced into the program at all when dynamically linked. So why do we need to give the path to the dynamic link library when we compile dynamically? ...
-
Which output of the following program is empty?
the following is the program source code:
class base{
private:
int x;
public:
void setx(int a) {x = a;}
int getx() {return x;}
};
int main(){
int * p;
base a;
a.setx(55);
p = new int(a.getx());
cout ...
-
A function to realize the specification of commodity selection.
now the question is how do I add the selection effect and does the VUE scaffolding used by the selected items have a big idea? Personally, I feel that there is something wrong with this data. It can t be realized at all.
...
-
Problems running btcpool's test program
< H2 > 1. Run the test program run_simulator < H2 >
after compiling the btcpool source code, run its test program
cd work btcpool build run_simulator
. simulator -c simulator.cfg -l log_simulator
this program does not live in hang, so it is "finis...
-
How do I keep a function in cache all the time in CPP?
at present, there is a function in a high-performance module in the project, which needs to be saved in cache all the time. A large number of other non-high-performance operations may be called during the execution of this function. The test result with...
-
What is the meaning of the operator int () method in the cPP structure?
I see a structure on boost.DI that I haven t seen before. What does the method in this structure mean?
struct width {
int value;
constexpr operator int() const { return value; }
};
struct height {
int value;
constexpr operator int() const { re...