Deep anatomy of C language [exercise continued]

Source: Internet
Author: User

 

Chapter 2

2.7
Leave a question:
For (I = 0, printf ("first = % d", I );
I <10, printf ("Second = % d", I );
I ++, printf ("Third = % d", I ))
{
Printf ("Fourth = % d", I );
}
What results are printed?

2.7.1
Let's first look at this: A ++ B and which of the following expressions want to be:
A), a ++ B;
B), a ++ B;

Chapter 3
3.1.4
Four questions:
A), # define sqr (x) * (x ))
# Define sum (x) + (X)
In the macro definition above, is "sum" and "sqr" a macro?
B), # define empty
Can this be defined?
C), print the macro defined value: printf ("sum (x)"); what is the result?
D), "# define M 100" is a macro definition?

Chapter 4

Three questions:
A) What is a pointer?
B), what is an array?
C) What is the relationship between arrays and pointers?

4.4.3
But if you modifyCodeWhat are the problems? What are the values of P3 + 1 and P4 + 1?
Int main ()
{
Char A [5] = {'A', 'B', 'C', 'D '};
Char (* P3) [3] = &;
Char (* P4) [3] =;
Return 0;
}
You can even modify the code:
Int main ()
{
Char A [5] = {'A', 'B', 'C', 'D '};
Char (* P3) [10] = &;
Char (* P4) [10] =;
Return 0;
}
What are the problems at this time? What are the values of P3 + 1 and P4 + 1?
We hope that you can consider these questions carefully.

4.7.3
(* (Char ** (*) (char **, char **) 0) (char **, char **);
Analyze the meaning of the above statements

5.3.5.4
Write two functions: generate a linked list and release a linked list. Both functions use only one header pointer.

5.3.5.5
Leave a question: Will an error occur if the NULL pointer is free multiple times in a row? Why? If you want to design free
Function, how do you deal with this problem?

 

 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.