Naming of C ++ code standards
I. Two basic naming principles
1. Clear meaning, not easy to confuse;
2. Do not conflict with namespaces of other modules or system APIs.
II. General naming rules
1. Standard English words or abbreviations shall be
[C ++ self-explanation] preface to basic series 4 static0
Storage Type of variables:Storage types are divided by the lifetime of the variables, including dynamic storage and static storage.
1) the lifetime of a dynamically stored variable is the
We often need to convert the string type to the int, long, double, and float types. The cctype header file provides the verification functions isdigit () and isxdigit () before conversion (). Through vs2010 experiment:
Main () {std: strDigit = "";
If you want to build a server application on Windows, you must consider the I/O model.Windows provides five I/O models:
■ Select );■ Asynchronous selection (WSAAsyncSelect );■ Event Selection (WSAEventSelect );■ Overlapping I/O (Overlapped I/O );■
When calling a function, we often see that the acceptance parameter of a function is (const char *);
For example, the strlen () function is defined:
*
So what are the benefits of setting the form parameter to const? The answer on the network is:
In fact, the question is a bit of an eye-catching, mainly to express the question of two points in the chunk_alloc function. I would like to ask you how to understand these two points.
The following describes the chunk_alloc code implementation, and
In fact, the implementation principle is very simple, that is, let the program respond to and process WM_DROPFILES messages. Three functions are used:
VOID DragAcceptFiles (HWND hWnd,BOOL fAccept); UINT DragQueryFile (HDROP hDrop,UINT iFile,LPTSTR
[Cpp]
// Find a loop, exchange one circle from one currency, and check whether the accumulation of the exchange rate is greater than 1// Extended the conventional minimum short-circuit bellman, which is calculated to dist (n), that is, to the
Question 15th:Question: enter a binary search tree to convert the tree to its image,That is, in the converted Binary Search Tree, the left subtree has more nodes than the right subtree.Use recursive and cyclic methods to convert tree images.For
If You Are the OneTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission (s): 98 Accepted Submission (s): 60
Problem DescriptionAs a member of the 2013 graduates in 6.99 million, James lost his job on the
# Include using namespace std; # define MAX 702/* 284 K 422 MS */typedef struct _ point {int x; int y;} point; point p [MAX]; bool judge (point a, point B, point c) {return (. y-b.y) * (c. x-b.x)-(c. y-b.y) * (. x-b.x);} int main () {int n; while
I recently read the source code of AVChat. The following code is used in its GlobalDefs. h file:
// TCP pack types const long PT_AudioMediaType = 10001; const long PT_VideoMediaType = 10002; const long PT_Payload = 10003; //
Give you a map of l from the start point to the end point, so that the distance is exactly equal to l. You can select a coefficient to stretch or contract the portrait map. For example, if you choose a coefficient of 0.5, that is to say, taking a
Sum It UpTime Limit: 2000/1000 ms (Java/Other) Memory Limit: 65536/32768 K (Java/Other) Total Submission (s): 4 Accepted Submission (s): 1 Font: times New Roman | Verdana | GeorgiaFont Size: Regular → Problem DescriptionGiven a specified total t and
Best SequenceTime Limit: 1000 MS Memory Limit: 10000 K Total Submissions: 4198 Accepted: 1662 Description The twenty-first century is a biology-technology developing century. one of the most attractive and challenging tasks is on the gene project,
Interview question: Enter the value n to print the n digits from 1 to the maximum. For example, if n = 3 is input, the question is printed from 1, 2, 3 to 999. This question examines the addition of a large integer, in my previous big Integer
1. Use a toothpick to open a small hole on the back three times to restore the default factory settings.
2. Set the IP address of the network card to automatically obtain the IP address. Enter Http: // 192.168.1.1 in the browser, press enter, enter
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service