1. The difference between a pointer and a reference
Answer: A, the pointer can be modified, the reference cannot be changed.
B, the pointer occupies memory, the reference does not occupy memory.
C, references cannot be null pointers
Type conversion has C-style, and of course, C + + style. C-style conversion format is very simple (type) EXPRESSION, but C-style type conversion has a lot of shortcomings, sometimes with C-style conversion is not appropriate, because it can be
1. Determine if the following procedures can be correctly output#include #includestring.h>voidNew (Char*p) {P=New Char[5];}voidMain () {Char*p=NULL; New (P); strcpy (P,"Hello");//requires header files Stdio.h and string.hprintf"%s", p);}Answer:
3. Compose an expressionA. Short-circuit evaluation methodA | | b If A is true, B is not evaluated and the expression is trueA && b If A is false, B is not evaluated and the expression is falseB.if () statement and the expression in sizeof ()650)
About tupleA tuple is one of C + + 11 's new standard libraries, which represents an n-tuple array, which is equivalent to a struct with n members, except that the members of the struct are anonymous. A tuple is a pair-like template , a tuple is
Today, I write a list class template, and then I write the same class as usual, the header file. h and. CPP are written separately, and then the compiler always prompts the class function is all unresolved external commands, followed by looking for
element is guaranteed to be stored continuously.Operator[] such as invalidate iterator, so cow notis no longer container so swap does not have to comply with rules that cannot copy/move/swap elements, so SSO worksReference is no longer
Content Summary:Synchronization of multithreading, mainly used in the MethodImplAttribute class and SynchronizationAttribute class, in essence, or based on the implementation of lock.A simple such as Xiao Ming and red Two people are the main with
1, static class can only have static members (including static fields, static methods), can not contain non-static variables. A static class cannot have a constructor function.2, static class inside can declare const variable and do not add static
Language-Integrated Query (LINQ) is the name of a set of technologies that are built on the direct integration of query functionality into the C # language (as well as Visual basic and any other possible. NET language). with LINQ, the query is now a
sometimes, a base class is not associated with a specific thing, but rather an abstract concept that provides a common interface for its derived classes. For this reason, the concept of abstract class is introduced in C # . Note:C + + programmers
Yes, play for a period of time the blog, now has been published are relatively basic knowledge of C #, and so on after the end of the foundation I will continue to publish some of the items on the project, because I am still learning, there are
usingSystem;usingSystem.IO;usingSystem.Security.Cryptography;usingSystem.Text; Public classMd5code {/// ///MD5 Check code for Get file/// /// file name /// Public Static stringGetmd5hashfromfile (stringfileName) {var
---------------Variables and Expressions---------------Assignment operators:+=;-=;*=;/=;%=For example:I+=j equivalent to I=i+jI-=j equivalent to I=i-jAnd so onBitwise operators:&--and |--or ^--xor ~--inversion >>--right shift For example:A binary
Read the catalogue:
Usage Scenarios
Algorithm principle
Virtual node
code example
Usage ScenariosFor Redis, for example, when the system needs to cache more content than the single-machine memory size, such as caching 100G
Common Parameters of g ++
-C compiled into the target file. o-O specifies the output file name. The output file name follows-o and is separated by spaces. If this option is not used, the default output file name is a. out.-G generates executable
C/C ++ Basic Data TypeBasic Type
The C/C ++ language has a set of basic types, which correspond to the basic storage units of computers and some common ways to use these units to save data:
The basic data types are as follows:
Name
[Dp] poj 3661 Running
Question:
A cow can run for n minutes and its fatigue is limited to m.
Next, you can run a [I] meters per minute.
Then, you can choose to run or rest every minute. Fatigue increases by a little.
Rest reduces fatigue every
C ++ smart pointerIntroduction to C ++ smart pointer
Many powerful functions of C ++ rely on pointers for implementation. However, pointers are the most error-prone. The most error-prone point is that when an object has been released, the pointer is
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