In C ++, once a temporary object is unnecessary, it calls the destructor to release the resources it occupies. The named object is in the opposite order of creation, call the destructor in turn.
C ++ source code:
CopyCode The Code is as follows:
Copy codeThe Code is as follows: # include
/* */
Typedef char * string;
Int main (void){String a [] = {"I", "like", "to", "fight ,"},B [] = {"pinch,", "and", "bight ."};Printf ("% s \ n", a [0], a [1], a [2], a [3], B [0], B [1], B [2]);Return 0;}
# Pragma preprocessing instructionsAmong all the pre-processing commands, the # Pragma command may be the most complex. It is used to set the compiler status or to instruct the compiler to complete some specific actions. # The pragma command
I think that the C language is still a beginner, and it seems that I have overestimated myself. I didn't expect such an interesting thing in this place. In some cases, I think it is necessary to go deeper to get started ....
=========================
To allocate space to a two-dimensional array (m * n), the code can be written as follows:
Copy codeThe Code is as follows: char ** a, I;
// Allocate m pointer units first. Note that they are pointer units.
// The size of each unit is sizeof (char *)
Link: C # Dynamic Keyword: ExpandoObject, DynamicObject, DynamicMetaOb application (I)
Why is the TryXXX method not called ??
Change the name modifier in DynamicProduct to private:
Private string name;
You can set a breakpoint in the TrySetMember
Question here: Question: Introduction to interview questions based on C # continuous assignmentIn msdn, The = Operator is described as follows:
The value assignment operator (=) stores the value of the right operand in the storage location,
ExpandoObject: indicates an object that can be dynamically added or removed at runtime.
Copy codeThe Code is as follows: dynamic dynEO = new ExpandoObject ();
DynEO. number = 10;
DynEO. Increment = new Action () => {dynEO. number ++ ;});
Console.
New Class Product:
Copy codeThe Code is as follows: class Product
{
Public string name;
Public int Id {get; set ;}
Public void ShowProduct (){Console. WriteLine ("Id = {0}, Name = {1}", Id, name );}}
The Main method code is as follows:Copy codeThe
I used to see an article on CodeProject: MBG Extensions Library
The author is generally introducing his own extension method class library. The content is as follows:
In ()
Copy codeThe Code is as follows: if (myString = "val1" |
MyString = "val2"
Some time ago, a colleague said
"300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Note: If the debugging mode is not enabled, the default debugging window is as follows:
Preparations before start:
Create the console program DebugWindowDemo:
Modify the code of Program. cs:
Copy codeThe Code is as follows: using System;
Using
The following is the source code of c ++:
Copy codeThe Code is as follows: class X {
Public:
Int I;
Int j;
~ X (){}
};Void f (X x ){X x1;X. I = 1;X. j = 2;
}Int main (){F (X ());}
The following is the assembly code of the main function:Copy codeThe
In c ++, IF operator = operation is not defined, the compiler provides a default operator = operation. Because operator = is similar to the copy constructor function, the copy operation is executed. Therefore, the compiler also provides useless
In c ++, if no destructor is provided for a class, the compiler will provide the default destructor for this class. Because the function of the Destructor is opposite to that of the constructor, the compiler also provides useless default constructor
The life and visibility of global variables are the runtime of the entire program. The following is a compilation of the actual situation:
C ++ source code:
Copy codeThe Code is as follows: int I = 2; // global variable
Int main (){Int j = I;}
The
Const is a common type modifier in C ++. A common type is a type indicated by a const. The values of variables or objects of a common type cannot be updated.
1. Define Constants(1) const modifies variables. The following two definitions are
Method 1: Use PainEventArgs in the Paint event of the control or form
Receives a reference to a graphic object in a form or control painting event, as part of PaintEventArgs (PaintEventArgs specifies the Graphics used to draw the control). When
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