« Home « Chủ đề kĩ thuật lập trình C

Chủ đề : kĩ thuật lập trình C


Có 60+ tài liệu thuộc chủ đề "kĩ thuật lập trình C"

Lập trình ứng dụng nâng cao (phần 5)

tailieu.vn

you create an instance of the ListBoxTest class named lbt and pass in two strings as parameters:. Console.WriteLine("lbt[{0. which is a helper method that returns a record based on the value of the string pro- vided. add a single string to the end of the listbox public void Add(string theString). The big change in this version of the program is...

Lập trình ứng dụng nâng cao (phần 6)

tailieu.vn

Console.WriteLine sBuilder);. using System.Text;. Console.WriteLine("theMatch theMatch.ToString(. The length property is the length of the captured substring, and I discuss it in the section “Using CaptureCollection” later in this chapter.. It is often convenient to group subexpression matches together so that you can parse out pieces of the matching string. Example 10-8 illustrates the creation and use of the Groups collection...

Lập trình ứng dụng nâng cao (phần 7)

tailieu.vn

where T is the type of the result object. In this example, because the query result is a set of Customer objects, the type of the result variable is IEnumerable<Customer>. the C# com- piler can infer the type of the range variable from the data source. In this example, because the type of the data source is List<Customer>. This portion...

Lập trình ứng dụng nâng cao (phần 9)

tailieu.vn

This code uses the rich Web Forms types found in the System.Web and System.Web.UI namespaces of the .NET FCL, and the System.Web.Extension namespace in Microsoft ASP.NET AJAX.. Typically, the client will not be in the same building as the server. Event handlers are written in C#, and are associated with controls in the HTML page through control attributes.. A web...

Lập trình ứng dụng nâng cao (phần 10)

tailieu.vn

private void btnClear_Click( object sender, System.EventArgs e. Creating the Application | 433 private void btnCopy_Click (object sender, System.EventArgs e). To get the selected filenames, you can walk through the source TreeView control:. If it is a File , you can add it to the new ArrayList. You can call its Sort. With that done, you can return fileList to the...

Lập trình ứng dụng nâng cao (phần 11)

tailieu.vn

The .NET Framework provides extensive support for serial- ization, and the final part of this chapter walks you through the details of taking control of the serialization of your object.. All the methods of the Directory class are static. therefore, you can call them all without having an instance of the class.. Table 22-1 lists the principal methods of the...

Lập trình ứng dụng nâng cao (phần 12)

tailieu.vn

method, passing in the stream and the object to serialize. using System.Collections.Generic;. using System.IO;. using System.Runtime.Serialization;. using System.Runtime.Serialization.Formatters.Binary;. using System.Text;. For this purpose, the .NET Framework offers isolated storage.. using System.IO.IsolatedStorage;. System.DateTime currentTime = System.DateTime.Now;. Programming .NET and COM 23. Rename it Calculator in the Properties window. Figure 23-1. Figure 23-2. Figure 23-3. Locating CalcControl in the VB 6 toolbox....

Lập trình ứng dụng nâng cao (phần 13)

tailieu.vn

Rank property, System.Array, 158 Rapid Application Development (RAD). Replace() method, StringBuilder, 227 Resize() method, System.Array, 158 resources. System.Array, 158, 175 root element, XML, 303, 307 Root property, DirectoryInfo, 489 Rows collection, ADO.NET, 373 rows, relational database, 369 runat=Server attribute, 391. set() method, for indexers, 180 SetAttributes() method, File, 492 SetCreationTime() method, File, 492 SetLastAccessTime() method, File, 492 SetLastWriteTime() method, File,...

Absolute C++ (phần 1)

tailieu.vn

1.1 INTRODUCTION TO C++ 2 Origins of the C++ Language 2. Samuel Johnson This section gives an overview of the C++ programming language.. ORIGINS OF THE C++ LANGUAGE. C became so popular that ver- sions of the language were written for other popular operating systems. The C language is peculiar because it is a high-level language with many of the...

Absolute C++ (phần 2)

tailieu.vn

<<. (number1/number2) <<. (number1%number2) <<. "Life, the Universe, and Everything is 42.\n";. ’A’ <<. ’B’ <<. ’\t’ <<. The input to the program is the amount of artificial sweetener needed to kill a mouse, the weight of the mouse, and the weight of the dieter. The simplest form for a Boolean expression consists of two expressions, such as numbers or...

Absolute C++ (phần 3)

tailieu.vn

For example, the square root of 9 is 3 because 3 2 is equal to 9.) The function sqrt starts with a number, such as 9.0, and computes its square root, in this case 3.0. The value the function starts out with is called its argu- ment . The function call. You can use a function call wherever it is...

Absolute C++ (phần 4)

tailieu.vn

This is often referred to as treating the function like a black box.. If a function is well designed, the programmer can use the function as if it were a black box. This means that the program- mer who uses the function should not need to look at the body of the function definition to see how the function works....

Absolute C++ (phần 5)

tailieu.vn

amountLeft has been decreased by the //value of the coins, that is, decreased by number*coinValue.. Each function should be designed, coded, and tested as a separate unit from the rest of the program. 7 //Precondition: The diameter parameter is the diameter of the pizza 8 //in inches. The price parameter is the price of the pizza.. In this case, you...

Absolute C++ (phần 6)

tailieu.vn

//Precondition: numberUsed <= declared size of the array a.. It is one of the easiest of the sorting algorithms to understand.. One way to design an algorithm is to rely on the definition of the problem. The value in a[0] is now the smallest ele- ment, and so the next-smallest element is the smallest of the remaining elements a[1. In...

Absolute C++ (phần 7)

tailieu.vn

Look at the definition of the member function DayOfYear::output given in Display 6.3. all the member names in the function definition are specialized to the name of the call- ing object. You use the dot operator to specify a member of the object today . For example, the heading of the function definition for the member function output would be...

Absolute C++ (phần 8)

tailieu.vn

If you make a mistake in your definition of the function so that it does change the constant parameter, then the compiler will give an error message. If you make a mistake in your def- inition of the function so that it does change the calling object and the function is marked with const , the computer will give an...

Absolute C++ (phần 9)

tailieu.vn

Look again at the defi- nition of the overloaded addition operator + given in Display 8.1. A friend function of a class is not a member function of the class, but it has access to the private members of that class (to both private member variables and private member functions) just as a member function does. For example, in Display...

Absolute C++ (phần 10)

tailieu.vn

Explain how this code can destroy the contents of memory beyond the end of the array.. Modify this loop to protect against inadvertently changing memory beyond the end of the array.. Be sure to #include the necessary header file to get the declara- tion of the function you use.. cout <<. strcat(aString, "Good, I hope.");. You can use a C-string...

Absolute C++ (phần 11)

tailieu.vn

Remove the lead numbers, any periods, and any spaces so that the first word of the title is the first word of the line.. Replace all dash - characters on any line before the end of the line by a space except the last one.. When alphabetizing the title, you don’t want to consider an initial “A”, “An”, or “The”...

Absolute C++ (phần 12)

tailieu.vn

Note that this also checks for the case of having the same object on both sides of the assignment operator.. 8 <The rest of the class definition is the same as in Display 10.10.>. 11 //Conducts one test of the class PFArrayD.. 24 <The definitions of the member functions for the class PFArrayD go here.>. With no overloading of the...