There are also many other translation names in the combination (Composite) mode, such as compositing mode, tree mode, and so on. The definition in design mode is that the objects are organized in a tree-shaped structure to achieve a "partial-overall"
C + + After studying for a while, I found that I had forgotten the most basic things, strcut (struct), Union (Union) I learned a bunch of things but forgot the two most basic;Now you have a good time to re-learn the things here;First, class (classes)
Compile-time polymorphism--function overloadingThe compiled intermediate code, such as GCC , produces an . o file. At this time is not assembly language) function name changes, look at the following two examples. void Cc_show (const char*str), _Z7CC_
Write a log class using c++11The main practice of thread mutex usageThe code is as follows:#include "stdafx.h" #include "Logger.h" #include #include logger::logger (const string & filepath): Filepath_ (filepath) {}logger::~logger () {Thread_.join ()
1, function overloading: Multiple function names are the same, but the parameter type, the number of parameters is different. For example: int myFunction (int,int);int myFunction (Long,long);int myFunction (long);function MyFunction (); It is
1. The default value of the parameter may be declared in the function prototype, and the default value is a value that is used when no parameter value is supplied.such as function prototype long myFunction (int x=50);The prototype indicates a
You cannot reuse the static keyword when you define it outside of a class
The static member function does not contain the this pointer (whether it is displayed or implicitly used)
Static members can be accessed through class objects or
When constructing your own class, it is possible to encounter mutual reference problems between the two classes, for example: a type defined in Class A class b,a is used and a type defined by a is used in B.
class A
{
B b;
I do not know why, the recent is always quiet not to learn, and do not know what the reason, suddenly, I would like to learn a C + + (I think: "I am very interested in learning a thing, this is not a bad thing," but I still mainly Java), because
Suppose Class C inherits from Class B, and Class B inherits from Class A. In addition to the ability to inherit member functions and member variables of Class C, the Class B inherits all members of Class A from Class A. In other words, Class C can
Read HTML information for a Web pageprivate string Gethtmlcode (string url){String Htmlcode;HttpWebRequest webRequest = (System.Net.HttpWebRequest) System.Net.WebRequest.Create (URL);Webrequest.timeout = 30000;Webrequest.method =
Common grouping Syntax
category
Code/Syntax
Description
Capture
(exp)
Match exp, and capture text into an automatically named group
(? exp)
Match exp, and capture the text to a
#region Background Verification PandaThe main code to verify the phone number is as follows:public bool Istelephone (string str_telephone){Return System.Text.RegularExpressions.Regex.IsMatch (Str_telephone, @ "^ (\d{3,4}-) \d{6,8}$");}The main code
Slowly found that the C language Foundation is so weak, by these characters input function confused and ~ ~Come and grieve once more.So, let's start with scanf:Say you want to enter a string of characters into a character array, such as the
C ++ Constructor
1. Default constructor
1. for class X, if there is no user-declared constructor, the default constructor generated by the compiler is useless.
2. The default constructor of the compiler synthesis (expansion) is useful in 4 cases
①.
Self-written c ++ two-way linked list
Try to use lambda and templates to write a linked list
#include stdafx.htemplate
struct Node{T Value;struct Node * pNext;struct Node * pPrev;};template
class List{private:Node
*
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