C ++ is developed on the basis of C and is compatible with C. But it is only compatible. It has its own complete set of language rules. Of course, you have its own characteristics, one of which is .
C ++ introduces namespace, which avoids repeated
1 #include 2 using namespace std; 3 4 namespace A{ 5 int a = 1; 6 } 7 8 namespace B{ 9 int b = 2;10 }11 12 namespace C{13 int c = 3;14 }15 16 int main(){17 18 int a = 10;19 int b = 20;20 int c = 30;21 22 using
I wrote a simple program, but some information needs to be printed on the console, just like the information displayed on the console when Apache Tomcat is started on Windows. After a while, the printf is encapsulated, and logs can be printed on the
I am currently working on C ++ references, so I have nothing to worry about. By the way, I will write the basic knowledge of references.
Introduction: What is reference
A reference is an alias of a variable (target). The referenced operation is
Preface
Clause 06: if you do not want to use the function automatically generated by the compiler, you should explicitly reject it.
With regard to these terms, I believe that the purpose of doing so is only one thing:
Intention: prevent you
You do not need to know about the Function calling rules (call conventions) most of the time. However, if you need cross-language programming, such as calling a DLL written by VC using Delphi, you need to know.
Microsoft's VC adopts the _ cdecl
In fact, this is also mentioned in C ++'s basic introductory books, such as C ++ primer, but few people pay attention to it. The author puts forward this point, to remind us.
The content of this clause is as follows 【Code snippet 1After being
Overview
Today, I heard from C ++ experts in the project team about C ++ exceptions and benefited a lot. Sure enough, you can learn more with the experts. Next I will share the C ++ Exception Handling introduced by this expert with the bloggers in
Let's take a look at two sections of code.
Segment 1:
1 union test{int b; char a[2];} shit; 2 3 int main(){ 4 5 shit.a[0]=10; 6 shit.a[1]=1; 7 cout
Output:
4266 press any key to continue...
Segment 2:
1 int main(){ 2 union
In C, if an int variable exists, it is very simple to convert it to octal, hexadecimal, and other outputs, you only need to select the corresponding one in printf.
But in C ++, how can we implement cout?
To control how integers are displayed, you
Sometimes it is found that the layout of the interface is relatively complex. to hide a part of the content, you need to use the dynamic sidebar method. Although a third-party control is used, sometimes it does not need to be so troublesome, I made
Propertyinfo. Attributes attributes
This attribute indicates the features associated with members. All members have feature sets defined relative to specific member types. The attribute feature allows you to know whether this attribute is a default
Why design patterns?
1. The design pattern is summed up by the predecessors based on experience. Using the design pattern is equivalent to standing on the shoulders of the predecessors.
2. The design mode makes the program readable. People familiar
Before I started to read expert C Programming, I was worried about the number of language-based books that have been written in 94 years (2012. Therefore, while reading, experiment with vs2010. Finally, we found that most of the content is still in
I learned C # and spent a long time learning regular expressions during format verification. It took me some time to sort them out for your reference. What are the errors.
Using sysyem. Text. regularexpressions. // The namespace that must be
Solemnly declare: This article is written by the author based on my personal understanding. errors are inevitable. Please be prepared!
You can reprint, modify, and indicate the source when reprinting!
Algorithm idea:
The method of directly
Solemnly declare: This article is written by the author based on my personal understanding. errors are inevitable. Please be prepared!
You can reprint, modify, and indicate the source when reprinting!
Exchange sorting should be the simplest and
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