C ++ usage learning experience and usage learning experience

Source: Internet
Author: User

C ++ usage learning experience and usage learning experience

Today, I am already a junior. When I think back to the class c ++ I learned in my freshman year, it is still like yesterday. When I graduated from high school, I was full of English words, poetic style, quadrant x and quadrant y, and came into contact with c ++. C ++ is a mainstream process-oriented and object-oriented programming language compatible with c. It is widely used to compile system software and application software. After getting started with it, I learned that there is another language in the world called computer language.

When we perform an experiment on the computer, we feel very boring, because every lesson is code-based, code-farming-like, and the final operation may fail. For example, source program: # include <iostream>

Using namespace std;

Class Complex {

Float Real, Iamge;

Public:

Complex (float r = 0, float I = 0 ){

Real = r; Image = I ;}

Void Show (){

Cout <"Real =" <Real <"\ tImage =" <Image <'\ n ';}

Complex operator + (Complex & c ){

Return Complex (Real + s, Image );}

};

Int main (void ){

Complex c1 (250000f, 500000f), c2 (1000000f, 2000000f), c3;

C3 = c1 + c2; c3.Show ();

C3 = c3+ 100; c3.Show ();

C3 = 100 + c3;

C3.Show ();

Return 0 ;}

After repeated debugging, I finally got to know three scenarios for adding the plural, but the "+" operator defined by Complex does not implement the third scenario, therefore, L1 program lines cannot be passed during compilation.

Finally, I think that books only give us an introduction to principles. As a computer student, you do not need to write a book or take a lesson in the future, therefore, the process of practice is very critical. From the understanding of the Program on the principle to the practice of writing the program by yourself, it is a good improvement in programming thinking. C ++ is a profound and profound programming language. It can be said that it is the foundation of many other languages. The languages I have come to use today are all C revisions or derivatives, so it is very important to learn it well.

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.