C ++ProgramMemory pattern is usually divided into four areas:
Global data zone;
CodeArea;
Stack area;
Heap zone (free storage zone ).
Global variables, static data, and constants are stored in
Global data Zone, All class member
Header file for input and output Header file of the string stream File stream header file Usage of stringstream 1. Use input and output for Data Conversion Stringstream Ss_stream;Ss_stream // Input int to the stream Ss_stream> Str ; // Output
Yesterday I encountered a class static function. I wanted to sort it out by myself. Who knows that someone has already done a good job, so I don't have to worry about it. After reading this article, I posted it to my own space, for later
Differences between C and C ++ static functionsThe static keyword is a keyword that exists in both C and C ++. It mainly has three usage methods. The first two are only used in C, the third method is used in C ++. (The detailed operations in C and C
The questions are:Http://post.baidu.com/F? Kz= 70481398Count the number of letters:ProgramEnter a string (up to 100 characters in length), all lowercase letters.Count the number of occurrences of lower-case letters and use the required graph.Test
1. write a function. The original form is int continumax (char * outputstr, char * intputstr) function: Find the longest consecutive numeric string , return the length of the string, and pay the longest numeric string to the memory specified
Const Type Definition: indicates that the value of a variable or object cannot be updated. The purpose of this definition is to replace the precompiled command.
********************** ***
function of cons (1) const constants can be defined,
Initialization definition method:
String S1; // default constructor. S1 is an empty string.String S2 (S1); // S2 is initialized to S1String S3 ("mengxm"); // S3 is initialized to a string literal valueString S4 (n, 'M'); // S4 initializes n
[Original] C ++ 11 right value reference
[Original] C ++ 11 lambda expressions
[Original] C ++ 11 Auto & decltype
[Original] Perfect forwarding for C ++ 11
[Original] C ++ 11 syntax dessert 1
[Original] C ++ 11 syntax dessert 2
[Original] C ++
Week_ptr is a weak reference to an object and does not increase the reference count of the object. Week_ptr and shared_ptr can be converted to each other. shared_ptr can be directly assigned to week_ptr. week_ptr can call the lock function to obtain
CodeStyle Guide: http://code.google.com/p/google-styleguide/use this code to understand and compile new code
Open source projects released by Google
Http://code.google.com/intl/zh-CN/opensource/projects.html
Google's complete open-source
In C ++ 11, asynchronous task async and future can be used together to complete lightweight concurrent programming. Async is easy to use. You only need to input the function to be executed concurrently. Future is used as a placeholder to obtain the
A function is a set of function object packaging templates that implement a generic callback mechanism. A function is similar to a function pointer, and has the advantage that it allows users to have greater flexibility in the implementation of the
Shared_ptr is a reference counting smart pointer used to share the ownership of objects. It can be constructed from a bare pointer, shared_ptr, auto_ptr, or weak_ptr. You can also pass the second parameter to the shared_ptr constructor, which is
The following key points are for all c ++ ProgramApplicable to all members. The reason why I say they are the most important is that ++ It cannot be found in the book or on the website. For example, the pointer to a Member is not to be mentioned in
1. Overload only functions of different return types cannot be overloaded.
2. The so-called private means that the member can only be accessed by the method of the class itself-even the object of this class cannot be accessed directly.
3. the
Recently I read "second edition of C language programming" and did the above exercises.
1. Write a program to print the histogram of the word length in the input.
First, if you do not enter a word, you need to enter a space, enter a word, enter a
The erase function is prototype as follows:(1) string & erase (size_t pos = 0, size_t n = npos );(2) iterator erase (iterator position );(3) iterator erase (iterator first, iterator last );That is to say, there are three usage methods:(1) erase (pos,
1. Evaluate the combination number: Calculate the combination of k numbers in the n number (1... n ....For example, combination (5, 3)Required output: 543,542,541,532,531,521,432,431,421,321,
/*Evaluate the combination number: Calculate the
The static members in the class are really a fascinating feature. I decided to summarize the knowledge points of static class members so that I would not be passive in future interviews.Static class members include static data members and static
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