First, the laboratory work 1.1 PTA Topic
6-1 recursive implementation of exponential functions
1. Design Ideas
- Double Calc_pow (double x, int n)
- if n equals 1
then return x;
Otherwise
n--;
Return to X*calc_pow (X,n);
2. Code
3.# #调试问题
- There is no debugging problem
1.2 Student performance Management System second, this week's topic set PTA Final Ranking
Third, read the code
- The topic is to design a code to understand the recursive function
- The advantage is that it makes me more aware of the use of recursive functions such as calculating the fun (3) process above: encountering fun at Execution (2), saving the current n (n=3) and Fun (2) return address after execution;
Then continue execution, continue to the local variables and function return address into the stack save. The stack is started until a recursive end condition is encountered.
Iv. Study Summary of the Week 1. Learning content
- 1. About recursive functions: a recursive function calls a procedure similar to a nested invocation of multiple functions, except that the calling function and the called function are the same function, and then his execution
It's kind of like a spring.
- 2. This week we studied the application of construction and multi-level pointers.
2. Learning experience.
- This week has a pointer to the exam, the test is not ideal, I analyzed the following reasons:
1. This week the code is not often touched, so in the exam when some knowledge points forgotten, such as
STRCMP was mistaken.
2. There is no clear understanding of the pointer, so the use of pointers is very confusing.
- So I realized that learning should be sustained, to understand C language.
C Language Blog Job--function nested call