1
# Ifdef _ XXXX
... Procedure 1...
# Else
Www.2cto.com
... Procedure 2...
# Endif
This indicates that if the identifier _ XXXX has been defined by the # define command, the program segment 1 will be compiled; otherwise, the program
I just wanted to read the book, but I recently read the design patterns and Objective C ++ books, which will be encapsulated in many C ++ books, because of inheritance and polymorphism, you have to take notes.
For virtual functions, in
Function of the extern keyword
1. Declare external variables or functions
When the variables or functions you need are in another file, in addition to include, you can also use extern to declare external variables or functions.
// File1.cppInt;Int
Law of emeter)
Definition: one object should have the least understanding of other objects
The core concept of the dimit rule is inter-class decoupling and weak coupling. Only after weak coupling can the reusability of classes be improved.
The
1. What is byte alignment? Why?In modern computers, memory space is divided by byte. Theoretically, it seems that access to any type of variables can start from any address, however, the actual situation is that access to specific types of variables
First, declare the global variables and critical value TCriticalSection * CS;// Global Zero-Boundary ValueDeclare the thread in the header file or new file (actually a class)// Download Thread class TMyThread: public TThread {public :__ fastcall
I haven't done any algorithm questions for a long time. I will repeat several simple algorithm questions.Question 1: Calculate the largest sum of sub-ArraysThis is a very common algorithm question. Many people can quickly write algorithms, but many
Previous: http://www.bkjia.com/kf/201205/132469.htmlI. Example
This example is from the book. Assume that there is a company's grouping structure as follows:
Its structure is similar to a tree. The human resources department and the finance
Volatile is interpreted as "unstable" in English, that is, the value of the variable modified with this keyword may be changed at any time. The type variables declared by the compiler can be changed by unknown factors, such as the operating system,
[Cpp]// Correlation analysis. hVoid XiangGuanFenXi (){Using namespace std;Const int M = 6209; // dependent series LengthConst int Cha = 4380; // length of the series to be interpolatedDouble H [M] = {0}, // Water LevelQ [M] = {0}, // trafficAverageH
We are familiar with the advantages of multithreading. We can make full use of system resources and reasonably schedule concurrent execution on the largest program. However, if the design is inappropriate, it will be contrary to the original
Priority_queueThe priority queue is a container adapter type. Based on some strict weak sorting conditions, a container with the maximum elements of the first element is specially designed.
Like a heap, you can retrieve the largest heap element (the
Problem:Specify the coordinates of N points on the plane to locate the two closest points.
Solution:We first sort the x coordinates of N points. We use the fast sorting method with the worst complexity O (n * logn, in the sorting process,
An oilfield is distributed in a region for you. As long as there is a link, it belongs to the same oilfield and several oil fields exist in the region.
Solution: A simple Bfs or dfs can be used to solve the problem. Pay attention to using the mark
This question is a little more difficult than the previous one. It means that a group of people send money to each other and all the numbers are integers. Each person sends different amounts of money, the number of friends is not the same for each
1 DefinitionEuler tour: a path that passes through each vertex once and only once through each edge in the graph.Euler circuit: a loop that passes through each vertex once and only once through each edge in the graph.Euclidean-a diagram with Euler's
[Cpp]/* The program is made by pyy *//*----------------------------------------------------------------------------//Copyright (c) 2012 panyanyany All rights reserved. URL: http://poj.org/problem? Id = 1887Name: 1887 Testing the
Q: rotate the string left.
* Title: Define the left rotation operation of the string: Move several characters before the string to the end of the string.
* For example, if the string abcdef is rotated two places to the left to obtain the string
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.