key segments: critical_section g_cs; entercriticalsection (& g_cs ); // Add the Code leavecriticalsection (& g_cs) to access Shared resources ); because the interlocked function is used in the key segment, the execution speed is very fast.
# Include # Include # Include # Include # Include Using namespace: STD;
Int main (){String F1 ("D: // 1.txt"), F2 (" D: // 2.txt"), F3 ("D: // 3.txt ");Map map_trans;String key, value;Ifstream trans_file (f1.c _ STR ());If (! Trans_file)Cerr While
Parameter transferEvery time a function is called, all the parameters of the function are re-created. The passed parameters will initialize the corresponding parameters.The initialization of the parameter is the same as the initialization of the
In standard C ++ applicationsProgramThe string is encoded in ASCII format, but the hosted type and application cannot process the ASCII string. To solve this problem, the managed C ++ uses a method that assigns a value to the system: string type
The example is as follows:
1,
//: c06: nojump. CPP // from thinking in C ++, 2nd Edition // available at http://www.BruceEckel.com // (c) bruce Eckel 2000 // copyright notice in copyright.txt // can't jump past constructors Class X {
1,
# Include using namespace STD; // ----------------------- int Hello () {cout
What is the output result? It is expected to be hello 1 World 3, at most Hello world 13.
But the actual result is World Hello 13. Why?
I debugged
1. Take C ++ as a new language learning (it has nothing to do with C! True );
2. Read thinking in C ++ and do not read c ++ as a dead horse (C ++ programming ideology, very poor translation );
3. read the C ++ programming language and inside the
1. All bits of an unsigned integer are used to represent a value without a signed bit; The highest bit of a signed integer is a signed bit. how to determine whether a piece of data is of the signed or unsigned type depends on how the command or
1. Try to use unsigned computing to prevent negative numbers,
Double speed will be faster than float; machine 32, 64 decides to use long or intThe default constant INTEGER (for example, 128) is of the Int or long type. (check whether the integer
Some time ago, I wrote an error log in the library. I created a file and wrote a file name to open it. In fact, the default is to the EXECurrent path. I just don't feel relieved whether the file can be opened successfully. After all, no absolute
I am looking for a job. I recently read 《ProgramEmployee Interview Guide (second edition), which has a question in the middle. The author's explanation is wrong. More importantly, there is a detail in it, which makes it easy for me to understand for
Class and structure instance comparison
Differences between classes and structures
How to Select structure or Class
I. Comparison of classes and structures:
Structure example:
Public struct person
{
String name;
Int height;
Int weight
Public bool
The previous article summarized the setlocale () usage of the C standard library. This article describes the usage of the locale class in the C ++ standard library.
Reference:
Cplusplus.com:Localization LibraryLocale class
Chapter 4
1. Meaning of void and void *
Void literally means "no type", void * is "no type Pointer", and void * can point to any type of data.
For void, if void a is defined, an error occurs during compilation (error c2182: 'A': Illegal use of type 'void' is
Array parametersVoid printvalues (int *);Void printvalues (INT []);Void printvalues (INT [10]); // the preceding three values are equivalent.Generally, defining an array parameter as a pointer is better than defining it using a syntax.In the third
Using C ++ to copy files is much more difficult than I thought, and it is more interesting to directly operate windows APIs than using C # Only file classes and directory classes. This process makes me realize not only the API, but also the essence
Since the birth of C #, the debate between C # and Java has been one after another. Objectively speaking, C # and Java are the fruits of traditional Object-Oriented Programming in the componentized software era. Although the two languages have "90%
Recently, when writing a program, you need to convert a floating point number to a string, especially when you execute SQL, you can search for sprintf_s from the Internet, but I did not try it successfully.
Later, we found that the following two
1. in C #, We have 5 Access modifiers: Public, private, protected, internal, and protected internal.
Their respective permissions are as follows:
Various access modifiers in C #
Public
Can be called anywhere
Private
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