C, C + + learning--the transformation of the way of Thinking (2) __c++

Source: Internet
Author: User
Last talk in learning C, C + + programming process, we should pay attention to the continuity of thinking into discrete thinking mode. The embodiment of this transformation is mainly the transformation of the system, the root of the function, the integral and the number of sequences. Perhaps many students in the beginners C language or other language, encountered series problems such as 1+2+3+ ... The problem, perhaps the first reflection is to use the high school stage of the sequence method to calculate that is N (1+n)/2. In fact, this is the continuum of thinking, which is obviously wrong, in the computer, we are stored in binary, each data is discontinuous, no matter how close the two numbers, it will never be on a curve of consecutive digits. Also in writing programs, we can not use this continuous method to consider the problem, we could use the discrete way to simulate it. For example, for the root of a higher function, we can use the binary method, which is to find the root of the equation with an approximation method. F (x1) *f (x2) <0 is, gradually shortening the distance between X1 and x2, knowing that X1 and X2 are very close to each other, we consider X1 or X2 to be the root of the equation. Discrete thinking is embodied in the programming process, which is why we should learn discrete mathematics. In the future, you will learn the data structure and algorithms, in fact, imperceptibly use the discrete way of thinking. Talk about here today, no matter what language you learn, learn C language, or C + +, Java, this is the form of problems, is posture, external things. But the transformation of the way of thinking is the internal strength, is the inner thing. If you learn C, C + +, a good grasp of pointers, is a wealth, this is a means to obtain. Learning Java students must have learned C language, pointers and the operation of the bit can make you more profound understanding of the way the computer works. This is just to say C language C + + is basic skills, no matter what language learning will be helpful.
Related Article

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.