# Include int a [100]; void prt (int n) {int I; for (I = 1; I = h) return; I = l; j = h; key = a [I]; while (I key) j --; if (I
This article is from the "to simplicity" blog, please be sure to keep this source http://zhijian.blog.51cto.com/205
The first time I got in touch with function pointers in my project, I used to see them in books, and I almost never used them. I don't know how to use them. I 've learned about it today, the following is a summary:
First, the function pointer
Learn C language from scratch, record the C language book recommendations and C language programming tutorials.
First, we recommend some books: The Example of C language getting started is simple and easy to use, and each example is very detailed.
C ++ STL tutorial
Score class of 14-ScoreManager
13-ScoreManger Score Management System
12-insert and delete a vector container
11-vector container iterator
10-Modify the vector container
09-Overview of vector containers
Owner of 08-C ++ STL
Idea: each time you extract the first element from the unordered table, insert it to the proper position of the ordered table. After insertion, the ordered table continues to be ordered.
Initialization: the first element to be sorted is an ordered
In simple sorting, no comparison results are saved. During the next comparison, many comparisons have been done in the previous one, so the comparison times are large. If you can save the comparison results at the same time of each comparison, the
Imagine how troublesome it is to find the book you need in a pile of scattered books. If you put the book neatly, for example, put it on the shelf, so as to move from left to right or from right to left) it is easy to search for the books you need
Search for its storage location in the index table based on the keyword, and then read the record from the storage location.
Each index item contains at least the location information of the keyword and its corresponding record in the memory.
8.4.1
For index search or continuous table search, you must compare keywords and search values. Do you need to compare them? You can use keywords to obtain the address corresponding to the keywords, this is the hash query.
Storage location = F (keyword );
1. Common usage of constConst int n = 10;Obviously, n is a read-only variable, and the program cannot directly modify its value. Note that int a [n]; in ansi c, this method is incorrect because the array size should be a constant, n is just a
Modular programming:
We can all see that the programs written by others are neat, standardized, and readable. Not all programs and functions unload a main file, but the entire project is subdivided clearly below, high portability.
Modularize a
The concept of class is nothing more than a collection of data and methods. Why have I been confused? Why not?The class concept in C ++ has four special functions. People like me who have C experience may not be able to adapt at the moment, they are
Four Methods of binary tree traversal: pre-order traversal, middle-order traversal, post-order traversal, and hierarchical Traversal
Before reading the Traversal method, Let's first look at the Declaration of the binary tree class:
Class
1. Introduction
Containers in the standard library define very few operations. Instead of adding a large number of functional functions to the container, the standard library provides a set of algorithms that do not depend on the specific
A: What is the principle of polymorphism in C ++?
Q: It is implemented through the late binding technology.
The implementation principle is as follows:
1. The function in the base class contains the virtual keyword, indicating that the method
An array contains three types of numbers: Negative, zero, and positive. You must scan the array only once, that is, divide the array into three parts: Negative, zero, and positive. I tried to write the code.
# Include # define N 9 void swap (int *
Write a simple C ++ Program
Each C ++ program contains one or more functions.Main. The operating system calls main to run the C ++ program. The following is a very simple main function, which does nothing but returns a value to the operating system:
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