C primer plus Summary

Source: Internet
Author: User

Well, it's an entry level. It's a collection of small issues and easy-to-be-ignored things I 've made when learning this book.

At the same time, he expressed contempt for the predecessor who invented the notebook touchpad.

I am stupid. I have made a lot of problems before, but I am slow at sorting out ...........

I will review C primer plus and prepare for the next step of in-depth study of C language and data structure.

Chapter 2

1,

Printf () applies % F, % E, % E, % G, % G. To both float and double types.

While scanf () only applies them to the float type, and "L" (l) modifier is required for the double type.

End of page 78

,

Enter a maximum scanf field width.

Scanf modifier: The maximum field width of digit (s). When the maximum field width is reached or the first white space character is encountered (whichever occurs first)

Stop reading input items

Example: "% 10s"

On page 79, 4.7

3,

* Different services are prompted in scanf. When it is placed between % and the English letter, it causes the function to skip the corresponding input.

Project. Program listing 4.17 provides an example.

/* Skip2.c -- skip the two integers in the input header */# include <stdio. h> int main (void) {int N; printf ("Please enter three integers: \ n"); scanf ("% * D % d ", & N); printf ("the last integer was % d \ n", n); Return 0 ;}

Output

Please enter three Integers

2004 2005 2006

The previous integer was 2006

82 top

4,

Place a blank character between two conversion specifiers to ensure that a number is not output together with the next digit even if it overflows its own field.

This is because the regular characters (including spaces) in the control string are printed.

82 page at the end of the page

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.