1 int myatoi (char * Str) 2 {3 int ret = 0; 4 int Sign = 1; 5 If (* STR = '-') // The pointer value is not negative * indicates the value & 6 {7 Sign =-1; 8} else 9 {10 ret = RET * 10 + (* str-'0'); // convert 11} 12 STR ++ by ASCII code; 13 while (*
1. Current scenario
In many movies and TV series, the Most martial arts is often eunuch. The so-called "to practice this skill, you must first go to the palace." Why is the martial arts of eunuch so high? I think it should be idle. If there are
This section focuses on the source code implementation of the tree structure.
First, we will discuss the storage structure of Binary Trees. Binary Tree storage structures include linear storage and chain storage.
1. Ordered storage structure of
This section discusses two interesting data structures: Stack and queue.
What is stack, the so-called stack is a linear table with Operations Limited at the end of the table. Because the end of a table needs to be inserted or deleted, it has a
From: http://jimmyloveforever.blog.163.com/blog/static/119775247200951303935836/ 1, C # The event mechanism is based on the delegate implementation, so we need to first define a delegate eventhandler:
Public Delegate void eventhandler (object from,
Event Mechanism
Class person {public string name; Public int age; Public String sex; public float money; Public Person () {This. name = "James"; this. age = 18; this. sex = "male"; this. money = 1000;} public person (string name, int age, string
Cluster
Linear Cluster
Non-linear Cluster
Linear Cluster
Direct access to the cluster (array, String, structure) arraylist, stringbuild, struct
Sequential access cluster (stack, queue) stack, queue
Index Cluster (hash, dictionary) hashtable,
The extension method is actually the syntax feature introduced in C #3.0 (I am out ). By using the extension method, you can add a method to an existing type "dynamic" without creating a new derived type or modifying the source code of the original
First, define the swap method used in the sorting process to exchange the values of two integers:
/// /// Exchange the values of two integers/// /// count 1 /// count 2 Private Static void swap (ref int AA, ref int bb){Int temp;Temp = BB;BB =
To facilitate development, the. NET class library has reserved several generic delegates.
1 func series Delegation
Definition of func series delegation:Public Delegate tresult func ();Public Delegate tresult func (T Arg );Public Delegate tresult
Read n text files and merge the files into a single text file. The readbyte and writebyte methods of filestream are mainly used:
Class filecombine{Public void combinefile (string [] infilename, string outfilename){Int B;Int n = infilename.
(1) concatenate and generate SQL statements:
String SQL = "insert into czyb (yhm, mm, QX) values ('" + txtname. text + "','" + txtpassword. text + "','" + cmbpriority. text + "')";Oledbcommand cmd = new oledbcommand (SQL, Conn );
This method is
The indexer is a special class member that allows an object to be accessed in an array-like manner, making the program more intuitive and easier to write.
1. Definition of Indexer
Class Members in C # can be of any type, including arrays and
Add "Microsoft Multimedia Control 6.0" and "Shockwave Flash Object" according to the method on the Internet, but the error "failed to import ActiveX Control" still appears, finally, I found that the reason for not pulling "Microsoft Multimedia
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Using system;
Using system. runtime. interopservices;
Using system. Threading;
Class testclass
{
Static void main (string [] ARGs)
{
New testclass ();
}
C # in an application, if you want to record the username, user level, user IP address, and so on of the login user, or abnormal conditions of the application (for example, the host where the application is located cannot be connected to the
1234567891011121314151617
// Define the IP Variable list IP = new list (); string strip = mtxtaddress. text. tostring (). replace ("", ""); // determines whether the IP address is null if (strip. equals ("... ") {MessageBox. show ("ip address
1) Use hnetcfg. dllUse add reference to import hnetcfg. DLL to the project. Three references are generated, mainly using netconlib. In the project, using netconlib is required. The following code is implemented: netsharingmanagerclass netsharingmgr =
The call of API functions in Windows is sometimes essential in programming. Various programming languages have standardized the calling methods and interfaces, the calling method in C # is as follows (the following programming environment is Visual
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