C-type delimiters const and volatile
1. Const
In the Declaration, const usually appears after the storage type and before the data type.
For example:
Static const int A = 3; // A is an integer constant of the static storage type.
Since the
The first question is: Write a function to delete a string.Str1String contained inStr2. This question is not difficult, but there is a KMP OptimizationAlgorithmFor more information, see.
The second question is: the given stringAAndB,OutputAAndB.
Recently I made a question and encountered the problem of removing spaces before and after the string. In Java, there seems to be a string function that is trim (), which can eliminate spaces after the string. For C ++, check that a C ++ standard
In Embedded Assembly, the C language expression can be specified as the operand of the assembly instruction, and you do not have to worry about how to read the value of the C language expression into which register, and how to write the calculation
Iii. Dependency inversion principle (DIP)
Dependence inversion principle: It depends on abstraction and not on specifics.
In short, the dependency inversion principle requires the client to rely on abstract coupling. Principles:
Abstraction should
The IF else statement is the most commonly used method for determining branch conditions. However, it is more intuitive and convenient to use switch when there are too many branch conditions. Here are two simple examples.
C ++:
Int num = 2;
Switch
Both. NET and Delphi encapsulate services well, but writing services in C ++ is still very cumbersome. Write some helper classes first:
// Manage the Service handleClass servicehandle {Public:Servicehandle (SC _handle h): H _ (h ){If (! H _)Throw
In many cases, I want to easily express multiple States with one variable. for example, if I have a window class that indicates whether the window has a system menu, a minimum button, a maximum button, or a Help button, four variables may be
Some people often ask this question. How do I retrieve and display the image of the photo field in the Employees table in northwind?The following is a common problem in the image display in this table: because the image data contained in the
After I wrote this article last time, I immediately noticed an error, that is, there may be node leakage. When a node is added, there is only one loop. When a node is added, the parent node may not be added, that is, the parent node cannot be found,
Recently, when writing code, I always find that the # include "windows. H" function in STL often causes compilation errors. But I think the code is correct. The following is the relevant code:
// Testmacro. CPP: defines the entry point for the
1. Inheritance
A very important feature of C ++ is code reuse. The method to reuse code in C language is to copy and modify the code. C ++ can be reused by means of inheritance or combination. Create new classes by combining or inheriting existing
/* Main functions:1. Input basic information of new books.2. Show All records3. query the basic information of a book by its name.4. Delete the withdrawn book information based on the book name.5. sort by book name from small to large.6. count the
I have been confused about this issue. I read this article and feel that the explanation is clear. I hope it will be helpful to others. (Actually reprinted)
C # language has two functions: A get function and a set function, which can be clearly
1. What is the problem with such initialization? Char * P = malloc (10); the compiler prompts "invalid initialization" cloud.
A: Is this statement a static or non-local variable? Function calls can only appear in the initial formula of automatic
This section covers some advanced topics, including Exception Handling, namespace and multi-inheritance, as well as special tools and technologies.17. Tools for large programs
Some features of the C ++ language are most useful when problems are
// Display the icon in the tray of the Windows system taskbar
// Use vc6.0 ++
// The code is adapted from Chapter 22nd of TCP/IPX protocol and network programming technology. Luo Junzhou and others are published by Tsinghua University Press.
The content described below is successfully debugged in the vc6.0 MFC program.
[1] use of hotkeys
It mainly uses two API functions: registerhotkey and unregisterhotkey. For details, see msdn. The edit box is used as an example to create cmyedit2,
Visual c ++ 5.0 programming experience (I)
Another method to change the window titleIn my article titled visual C ++ September 1, 1997 programming experience, published in 4.0, I mentioned a method to change the window title, modify the
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