A few days ago a friend asked me about the C language compiler principle and compiling process, at that time I did not explain white, today deliberately in the book and online access to information, a simple summary of the C language of the compiler
a simple string compression
Write a string compression program that compresses the repeated letters that are present in the string and outputs the compressed string.
Compression rule:
1, only the consecutive repeated occurrences of the character
1. If a class's declaration and implementation are in the header file and there is no corresponding CPP file, the compiled dynamic library does not export the class (VS2008) Even if it is declared as an export class (__declspec (dllexport)).
2. If
The underlying development is generally in C language, which involves the management of memory, the application and release of pointers.
A double buffer queue was recently used, resulting in an exception when it was released. The allocation of
13th Chapter Copy Control
1 Copy constructors, assignment operators, and destructors are always referred to as replication control.
21 common scenarios require classes to define their own replication control members: The class has pointer members.
Quick Sort is a sort of divide-and-conquer method, and a quick sort divides n elements into three segments. Left segment, right segment, and middle segment, with only one element in the middle. I'm called the key value. The elements on the left are
1. Intelligent pointer Concept
A smart pointer is a class (template) that is implemented based on the RAII mechanism, with pointer behavior (overloading the operator* and operator-> operators) to "intelligently" destroy the objects it refers to. C+
1: For C-style strings such as Char*,char str[], convert to Stringchar * and char str[] types can be directly converted to string types;That is, in char * chstr,Char arstr[]String str=chstr, or string str=arstr, which can be assigned directly.2:
Self-increment, self subtraction operator.
Self-Increasing: i++,++i
Self minus: I--,--i
The difference between i++ and ++i: When i++ and ++i are on a single line, both are implemented i=i+1, but the difference is that i++ first uses I and then
Mixed operations between various numerical data
Char, Short->int->unsigned->long->double
At the time of operation, different types of data are converted to the same type first, and then the operation is performed.
C language Operator:
Arithmetic
If a class member of C + + has a virtual modifier, then an object called VTBL (the virtual table) is formed in the instantiated objects, and the so-called polymorphism is achieved with the lag binding function inherent in C + +. Below, I use C code
void Str_run (char *primary_str, char *lookup_str, char* replace_str, char* new_str)
{//function is to find lookup_str in Primary_str, find Lookup_str replace replace_str, otherwise do not replace, return the new NEW_STR
int cn = 0, CL = 0;
Char
1, take the first I characters of the string
(1) String str1=str. Substring (0,i);
(2) String str1=str. Remove (i,str. LENGTH-I);
2, remove the first I characters of the string
String Str1=str. Remove (0,i);
String Str1=str. SubString (i);
Recently find a job interview, encounter some understanding of the problem record share:
1, wm_copydata with SendMessage or PostMessage.
The message can only be sent by SendMessage () and not by using PostMessage (). Because the system must manage
Replace and replaceall are commonly used substitution characters in Java, and they differ in the following ways:
1 The parameters of Replace are char and charsequence, that is, can support the replacement of characters , but also support the
The header reference code is as follows:
Using System;
Using System.Collections.Generic; Using System.Linq;Using System.Text;
Using system.reflection;//the first four lines of code are generated automatically when we create the program, we only
1 Download: http://www.msweet.org/downloads.php?L+Z3
2 Description: Mini-xml is a small open source XML parser, using C language development. The biggest feature of this parser is that it is small, does not need to rely on other class libraries,
. NET does not encapsulate methods for obtaining timestamps (unixtime, relative to the number of milliseconds in the early hours of January 1, 1970). So I wrote the following methods to achieve.
Remind the friends in the groping, note the rounding
Remove the Anchor property of the multiple buttons inside the Pannel, as shown below:
Then use the tool with VS2010 to adjust it:
Note
Sometimes we just think that the relative position of the child control in the parent control does not
http://blog.csdn.net/haoel/article/details/3081385
memory layout for C + + objects (bottom)
Chenhao
Http://blog.csdn.net/haoel
Repeat Inheritance
Let's take another look at the case of duplicate inheritance. The so-called duplicate inheritance,
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