1. What is the purpose of static?
First, let's look at the memory distribution of the c program.
Database with local variables on the stack.
3. What causes stack overflow?
Stack Overflow is generally caused by recursive calls. If you use a local variable of the big data structure, it may also cause stack overflow.
Garbage collection does not cause memory leakage and the final memory is exhausted.
4. The parameter type that cannot be used for switch () is: Real. (It can only be int or char ).
5. Write the if statement for comparing float x with "zero value.
Because the float precision is the last six digits of the Primary School, the correct comparison statement is:
If (x <0.000001 & x>-0.000001)
6. convert a character into an integer function and its prototype.
Atol ();
Function prototype.
Long atol (const char * nptr );
7. How should I implement a frequently used short function in C? How can I implement it in C ++?
Only macro definitions can be used in C, and inline can be used in c ++.
8. What types of software testing are available:
Black box testing: testing system functions.
White-box test: test function functions and function interfaces.
9. determine at which stage of the software design the module functions and module interfaces are completed?
{
Software design process:
1) market research
2) Demand Analysis
3) Outline Design
4) Detailed Design
5) Encoding
6) test
7) Maintenance
}
A: determine the functions and interfaces of the module in the outline design phase.
10.
Unsigned char * p1;
Unsigned long * p2;
P1 = (unsigned char x) 0x801000;
P2 = (unsigned long x) 0x810000;
Excuse me, p1 + 5 =? ;
P2 + 5 =? ;
The preceding questions examine the length of char and long. The char length is 1, and the long length is 8.
While p1 is an address, * p1 represents the value of the address. The address is in hexadecimal format.
Therefore, address + 5 is equivalent to address increase. 0 + 5*1 = 5; 0 + 5*4 = 20 = 014.
Answer: p1 + 5 = 0x801005;
P2 + 5 = 0x810014;
11.
What are the following program errors?
Int a [60] [250] [1000], I, j, k;
For (k = 0; k <1000; k ++)
For (j = 0; j <250; j ++)
For (I = 0; I <60; I ++)
A [I] [j] [k] = 0;
Replace internal and external loop statements
(This is correct during compilation, but an error occurs during running, but this array is too large. If it is placed in the stack, it will still overflow and be used as a global variable)
12. unsigned char 0-255
# Define Max_CB 500
Void LmiQueryCSmd (Struct MSgCB * pmsg)
{
Unsigned char ucw.num;
......
For (ucloud num = 0; ucloud num
{
......;
}
Infinite Loop (unsigned char 0 to 255)
13.
The following is a program to calculate the square of a number. Please find out the error:
# Define SQUARE (a) * ())
Int a = 5;
Int B;
B = SQUARE (a ++); // a is added twice. a = 7, B = 25