extension)Path.GetFullPath (strpath) Get the original path of the filePath.getdirectoryname (strpath) Gets the name of the folderPath.Combine (path 1, path 2) Merge pathPath.changeextension () Change extensionFile Management (I/O)--directoryDirectory.CreateDirectory (path) Create fileDirectory.delete (path) Delete fileDirectory.GetFiles (path) gets all the files under the pathFile Management (I/O)--filestream (binary stream)static void Main (string[] args) { int i = 0;
C ++ review-standard library-set
Set is a set that satisfies uniqueness,The standard library set in C ++ is a class template,
Template
, // Set: key_compare/value_compare class Alloc = allocator
// Set: allocator_type> class set;
For normal use, you need to provide category parameters such
Set
Str_set;
For a custom categor
C # bubbling Algorithm reviewBubble algorithm Meaning: Each trip to find a minimum or maximum number to the last side, compare the total number of n-1 times (because the comparison is 2 both compare)The second loop represents the first few loops, the number of trips equals the number of comparisons-the number of times (the second trip is less than once, because the smallest one after the first trip)usingSystem;namespacetest{classProgram { Public Stati
Use the "back-to-text algorithm" to review the C ++ language ., Text Algorithm
1. What is text return?
Given a string, read from the back and from the back without changing the string sequence. For example, the customer service phone number of Hebei rural credit cooperatives is "96369". Whether it is read from the back to the back or back to the back, the positions of each character remain unchanged.
Ii. fu
of 0 rows 0 column elements and 1 rows 0 columns of elements. Conversely, the pointer to the column is preceded by a , which becomes a pointer to the row. For example, A[0] is a pointer to a 0-row 0-column element, preceded by A as a[0], because a[0] is equivalent to * (a+0), so a[0] is equivalent to *a, which is equivalent to a, which points to 0 rows of a two-dimensional array. Do not take a[i] as the physical address of the a[i] element, because there is no real data storage unit such as A[
any string, and that the subsequence does not require consecutive characters, but that the order is consistent with the main string.Some differences between 8.strcpy and memcpy:1) Different content is copied, strcpy can only copy the string, memcpy can copy any content. strcpy is used only for string copying, and it copies the Terminator of the string, not only the contents of the string. The memcpy has no limitations on what needs to be replicated and is therefore more widely used.2) The metho
//p is the function pointer, a is the lower bound, B is the upper bound, N is the equal numberfloatIntegralfloat(*p) (float),floatAfloatBintN) { inti; floatArea=0; floatew = (b-a)/N; for(i =1; I ) Area+ = (*p) (A + i*ew) *ew; returnArea ;}floatF_sin (floatx) { returnsin (x);}floatF_cos (floatx) { returncos (x);}floatF_exp (floatx) { returnexp (x);}intMain () {floatA, B,area; float(*p) (float); intn = -; printf ("Test Sin,input A, B:"); scanf ("%f,%f", a, b); P=F_sin; Area=Integral (
One, what is back text
Given a string, the string sequence is unchanged from the time it is read and read backwards. For example, Hebei Province, rural credit cooperatives, customer service telephone is "96369", whether from the forward reading, or backward reading, the position of each character appears unchanged.
Second, function realization
(a), given a string, that determines whether the string is back text.
(b), given an arbitrary string, to determine whether it can be converted to back
Preparations before the interview --- C # knowledge Review ---- 01,
After the year, I was ready to find a new job. Although I had a good job in my hand, I had to move the tree to death and move people to work. We cannot keep living in a trap for a lifetime. the world outside is beautiful after all.
In order to find my favorite job, I recently reviewed all the basic knowledge. Record-only, self-encouragement
Call a stored procedure and receive query results from multiple tables a table with one datatable,dataset can store multiple Datatabledataset need SqlDataAdapter to populate the dataSqlConnection con =NewSqlConnection ("Database Links");//Create a database connection objectCon. Open ();//Open Linkvarcmd = con. CreateCommand ();//Create a database action object from a linked objectCmd.commandtype = CommandType.StoredProcedure;//set action type as stored procedureCmd.commandtext ="Stored Procedure
string xml = "XElement root = Xelement.parse (XML);String strbook = root. Element ("book"). Value;string strage = root. Element ("Age"). Value; return as "" instead of NULLDataTable dt = new DataTable ();Dt. Columns.Add ("AA");Dt. Rows.Add (New Object[]{dbnull.value});string aa = dt. Rows[0][0]. ToString ();//returns to "" instead of NULLbyte[] buf = new byte[1024*1024];MemoryStream m = new MemoryStream (); Test it out, MemoryStream will automatically release it.for (int i = 0; i {M.write (buf,
can only access the static field, and you can call only the other static methods in the class. A non-static method must first create an instance before the methods can be called on the object.To create a shared field:When a field is defined as static, you can create a field that can be shared among all objects of the class. Modifying a static field will work for all objects. Call a static field to make a call using the class title as a prefix.To create a static field using the Const keyword:The
Richter conversion:1, subclasses can be assigned to the parent class2. If a child class object is loaded in the parent class, you can convert the parent class to a subclass object.3, as4, isIf a subclass inherits a parent class, the subclass can use the members inherited from the parent class in addition to its own members.However, the parent class can always use only its own members, not the members of the child classesSub-classes cannot use each other's members classProgram {Static voidMain
Declaring enumerations:Enum Season{spring,summer,fall,winter}If you do not specify a constant integer type for enumerating an enumerated literal constant, the compiler automatically assigns a value to him that is older than the previous enumerated literal constant.Enum Season{spring=1,summer,fall,autumn=fall,winter}Select the basic type of enumeration:Enum Season:short{spring,summer,fall,winter}Declaration structure:struct TIME{private int hours,minutes,seconds;Public time (int hh,int mm,int SS)
Ref,out,paramsRef vs. out1: When using a ref parameter, the passed-in parameter must first be initialized, and for out, it must be initialized in the method.2: When using ref and out, add the ref or out keyword to match the method's arguments and execution methods.3: Out applies where multiple return values need to be returned, while ref is referenced when the caller is modified by the method that needs to be called.Here are the following:Ref1: Code Reference2,ref usage: When passing a parameter
(1) Capitalization of namesPascal case Form RulesIn the name of the first letter of the word, the namespace, the class, and the member names in the base class should follow this ruleUsing System;Class ProgramCamel Case Form RulesSimilar to the Pascal form but with the first letter lowercaseThe following three cases can be used in camel rules1, the name of the field for all private members of the type: private int userId But note that member fields are often prefixed with the private int _userid2
created. Look at the outer if statement block, which allows each thread to acquire an instance without having to lock each time, because only if the instance is empty (that is, an instance needs to be created), the lock creation is required, and if an instance already exists, the instance is returned directly, saving performance overhead. 2, a hungry man mode this mode is characterized by its own active instance. Public Sealed classsingleton{Private Static ReadOnlySingleton instance=NewSingle
precautions are summarized above, which should be kept in mind because the compiler is unaware of these rules and therefore cannot discover errors).* For all Class members assigned by new when pointing to memory, delete should be used in the class's destructor, which frees the allocated memory.* If the destructor frees memory by using delete on pointer class members, each constructor should use new to initialize the pointer, or set it to a null pointer.* You should define a copy constructor tha
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.