First
, the main content of this lesson:
This chapter mainly introduces the basic knowledge of pointers, this lesson is mainly as follows
(1) Through the example "password unlock" introduced the concept of pointers and the main points of knowledge, the process of unlocking the password to explain the relationship between variables, memory units and addresses, so as to introduce the basic concept of pointers, and then introduced the basic operation of pointers and the initialization of pointer variables.
(2) Using the example "Role interchange" to introduce pointers as function parameters for use and usage, distinguish by value calls and reference calls, analysis of 3 swap () functions to compare, and finally through a given year and days to calculate is a certain day of the month of the instance learned how to use pointers as function parameters to return multiple values, Resolves an issue where the previous function can return at most one value.
(3) Using the example "bubble sort" to introduce the array name as a function parameter, focusing on the relationship between pointers, arrays, and addresses, the example shows that pointers and arrays can achieve the same operation. This paper gives a comparison of the selection sort of the last lesson learning.
second, the experimental content: (70 points)
1. Re-doing the textbook on P191 example 8-5, requires the use of the choice of sorting algorithm and bubble sorting algorithm to achieve respectively. (Note: The corresponding two functions, respectively, are called by the main function)
2. Write a function that uses the pointer to find the maximum value and call it with the main function.
。
3. Implement a simple function that splits the integer and fractional parts of a real number and is called with the main function.
4. Find the specified element in the array: Enter a positive integer n (1<n<=10), then enter n integers into array A, enter an integer x, find x in array A, and if found, output the corresponding subscript, otherwise "not found" is displayed. The request defines and invokes the function search (int list[],int n,int x), finds the element x in the array list, returns the corresponding subscript if found, otherwise returns-1, and the parameter n represents the number of elements in the array list. Try to write the appropriate program.
third, the experimental requirements:
1. deadline:2016-12-8 20:00pm of the job
2. Upload the code of the experiment content to the https://coding.net/website. (60 points)
3. Write an essay, divided into four parts: (total 40 points)
Write this lesson to learn the knowledge and experience, the length of study, the learning process encountered problems, problem solving methods and doubts and so on.
The format of the essay is as follows:
Title: Basic application of experimental 11--pointers
The learning points of this lesson: (5 points)
(1) .....
(2) .....
...........
2. Problems encountered during the experiment and solutions: (10 points)
(1)
(2)
.......
3. Experimental experience and summary of this chapter (10 points)
.........
4. Reflections and Answers to several questions (15 points)
(1) Two pointer variables of the same type can add? Why
(2) When using the scanf () function, the input parameter list needs to use the Fetch address operator &, but when the argument is a character array name and is not used, why? What happens if you precede the character array name with the fetch address operator &
(3) The C language is not allowed to assign values directly to an array using an assignment expression, why?
Iv. Additional questions:
1. A function is required to determine whether a given string of characters is a "palindrome". The so-called "palindrome" refers to both reading and reading the same string. such as "Xyzyx" and "Xyzzyx" are palindrome.
2. Two points to find. An integer array A of 10 elements is set, sorted by value from small to large. Enter an integer x, then look for x in the array, and if found, output the corresponding subscript, otherwise output "not found".
Five, the Operation evaluation method:
Total score 100: Among them, the coding program submits 60 points (according to the code steps, the format, the annotation, the structure correctness assigns the discretion), the blog writes 40 points, the delay day deduction 10 points, until the deduction 100 points.
C Language Programming 11th time job