1. When a large data structure is passed as a parameter, using a reference or pointer as a function parameter can save a copy process and improve efficiency.
View othersCodeThis is often used. Think about why
Void fun1 (const classa &); void fun2 (
For a class without defining public access permissions, it is often useful for other classes to operate on its private members. For example, if you write a binary treeCodeNode is a node class. It is convenient to allow functions connected to
I am using vi + gcc
In Linux, We will compile a small C ++Program, Steps:
1. Run Vim test. cpp in terminal.
Write in test. cppCode:
# Include Int main (){STD: cout Int V1, V2;STD: CIN> V1> V2;STD: cout Return 0;}
Exit after editing: WQ
Execute
1. The time in the C ++ standard library must reference time. h. The local time or Greenwich Mean Time can only be accurate to seconds.
# Include /* contains the time header file */# include using namespace STD; int main () {// time_t is of the
// Strcpy usage: // 1. If the source length OK. // Copy the source string to the target string (including the ending character), and keep other bytes unchanged. // 2. If the source length is greater than the target length, an error is returned. //
I have never used Nant and nunit to build C # code automatically. Today I wrote a C # program and want to build C # code with Nant and nunit. You may have trouble running unittest after writing the Build File. The command line prompts: cocould not
1. Separate Compilation
1) do not place the function definition or variable declaration in the header file.
Cause: a header file contains a function definition, and the other two files (the same program) contain this header file. Then, the same
Bitwise operation
Bitwise operations in C include bitwise operations (&), (|), (^), and non (~).
The following code package expands these basic operations, and there is also a two-digit Exchange (not a third number ).
#include#include//print a int
Today, I encountered a problem of global array and partial array in C language. After a long time, I did not see the problem immediately. Now I will sort out the problem and provide a solution.
Problem description:
Arrays declared globally have
I don't understand it. I will try it later.
2012-3-26
The input and output of C ++ are provided by the standard library. The standard library defines a family of types that support reading and writing files, control windows, and other devices.There
In fact, there is nothing to say. I just did a test to find out why there are some inexplicable rules.I have never understood this before when I learned C ++. I hope it will be helpful to some people ~~The following source code is passed in VC ++ 6.0
For beginners of C Language
Author: LDAP from Cu
A few days ago, I wrote a post entitled "notes worth attention in UNIX C Language", which talked about the issue of learning high-quality code from open-source software outside China, but some
1. Basic explanationExtern can be placed before a variable or function to indicate that the definition of a variable or function is in another file, prompting the compiler to find its definition in other modules
Singleton
The Singleton pattern: ensures a class has only one instance, and provides a global point of access to it.There is only one instance class. The following are several considerations:First, you must call the constructor to generate a class
The teacher has a way to give lectures. A teacher first lectures in a remote mountainous area in the west, standing in front of a wooden blackboard in the classroom. After several years of good performance, he has been transferred to a better city,
C # is an object-oriented language. In the object-oriented thinking, only objects can be described in classes. For example, Int, bool, Char, String, double, long and so on are all classes. For example, 30, 2.5, and "test" are all objects of the
Object-oriented features: encapsulation, inheritance, and polymorphism. Where do classes inherit from? In object-oriented languages, there are base classes or superclasses, that is, all classes are inherited from this class. This superclass is
The cross-platform Integer type of Ace has always been used, such as ace_uint32. However, the C ++ style is obviously modern, and the model is dominant, so recently, we began to gradually replace ace the ace code and use the boost library
When you use Embest IDE to debug B0, you want to operate internal registers in the C environment. I checked a lot of information, but the compilation was always fail. According to the _ ASM format in the book, it is still wrong. Later, after one day
The Linux development environment is quite complete and has complete functions. It mainly consists of GNU compilers and libraries, as well as a large number of system routines and libraries, and supports C ++, C, and assembly language programs, the
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