The content discussed in this article is based on the following environment:Microsoft Visual C ++ 6.0Oracle 8i (8.1.7)
Current version: 1.0 (041221)
Disclaimer: some operations described in this article may have a major impact on the system.
Static
For all objects of a specific class type, it is sometimes necessary to access a global object. However, for a class, global objects may destroy encapsulation. Instead, the class defines static members to replace a universally accessible
Attributes is a brand new declarative information. We can not only define design-level information (such as help file and URL for documentation) through features, but also run-time information (such as associating XML with class ), we can also use
Doubt:
This is a self-defined class that calls the mapobjects2 object control and prepares to write an attribute to store the operated mapobjectes object. However, an error is found when writing this attribute. That is, after get and set, the
There are many sayings on the Internet:Differences between static and dynamic JSP content:
Dynamic include is implemented using JSP: include action.
Flush = "true"/> it always checks for changes in the contained files. It is suitable for
Use
C #
Various sorting algorithms1. Bubble Sorting: using system;
Namespace bubblesorter
{
Public class bubblesorter
{
Public void sort (INT [] list)
{
Int I, j, temp;
Bool done = false;
J = 1;
While (j {
Done = true;
For (I = 0; I {
If (list [I]>
During this time, I learned the C language and wrote the following code:
Struct student{Char name [50];Char number [12];Struct student * next;};
Int main (){Struct student * head, * p, * temp;Head = (struct student *) malloc (sizeof (struct student )
All content from: http://www.partow.net/programming/hashfunctions/
The following provides a total of 10 string hash functions. In the above link, you can find descriptions of each hash function and download some other information about the hash
The standard C console program can also customize the text output color to make the print information clearer, which is particularly useful in debugging. The method is simple:
From:
# Include # Include Int isPrime (int n );Int main () {int I = 2; for (I = 2; I Int isPrime (int n) {int I = 0; for (I = 1; I Return 1 ;}
# Include Int main () {int a; int B; int t; int k; printf (\ "please input a and B \"); scanf ("% d ", & a, & B)
# Include # Include # Include # Include # Include # Define N 25000 // number of elements to be sorted
Void insertsort (int R [N + 1]) // sort by direct insertion{Int I, j;For (I = 2; I R [0] = R; // Set monitoring recordJ = I-1;While (R [0] R [j + 1]
References are a concept in C ++. Beginners can easily confuse references with pointers.In the following program, n is a reference of M, and M is a referent ).Int m;Int & n = m;N is equivalent to M alias (nickname). Any operation on N is an
The sample code is as follows:
# Include Using namespace STD;Class Internet;Class country{Public:Country (){Strcpy (cname, "China ");}Friend class Internet; // statement of the friend classProtected:Char cname [30];};Class Internet{Public:Internet
A common function can be a friend function of multiple classes., We modify the above Code and observe the changes:
# Include Using namespace std;Class Country;Class Internet{Public:Internet (char * name, char * address){Strcpy (Internet: name, name )
The definition of virtual functions follows the following important rules:
1. For exampleIf the virtual function appears in the base class and the derived class, but the name is the same, the form parameter is different, or the return type is
Old problems. I have summarized some omissions and errors.
About using braces for initialization:Class and struct cannot be initialized using braces if constructors are defined.If no constructor is defined, struct can be initialized with braces.If
1. when the template definition and declaration are placed in the hpp file and cpp file respectively, a link error occurs. There are three ways to solve this problem: 1) Add # include "at the end of the hpp file. hpp "2) in # include ". # include ".
It also supports object-oriented design languages. Some modifiers of Java and C ++ share the same, but these modifiers are not exactly the same due to different design concepts.
Abstract modifier:
Abstract modifier semantics in Java is abstract, the
First look at a line of code:Int x [] = {1, 3, 5 };Here, we declare that x is an array with three int elements. There is a lot of such code in C language, which is too common. There seems to be nothing to be curious about, so what about C ++?Well, C
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