List C ++ code programming methods

Source: Internet
Author: User

C ++ is a large-scale language widely used in industrial software development. The following describes C ++ code and some skills related to C ++ code editing, now let's talk a little bit about it. Let's join in the mysterious world of C ++.

 
  1. 1: #include <iostream.h>   
  2.  
  3. 2: #include <conio.h>   
  4.  
  5. 3: #pragma hdrstop   
  6.  
  7. 4:   
  8.  
  9. 5: int multiply(int,int)   
  10.  
  11. 6: void showResult(int);   
  12.  
  13. 7:   
  14.  
  15. 8:int main(int argc,char **argv);   
  16.  
  17. 9:{   
  18.  
  19. 10: int x,y,result;   
  20.  
  21. 11: cout << end1 << "Enter the first value:";   
  22.  
  23. 12: cin >> x;   
  24.  
  25. 13: cout << "Enter the second value: ";   
  26.  
  27. 14: cin >> y;   
  28.  
  29. 15: result=multiply(x,y);   
  30.  
  31. 16: showResult(result);   
  32.  
  33. 17: cout << end1 << end1 << "Press any key to continue...";   
  34.  
  35. 18: getch();   
  36.  
  37. 19: return 0   
  38.  
  39. 20: }   
  40.  
  41. 21:   
  42.  
  43. 22: int multiply(int x,int y)   
  44.  
  45. 23: {   
  46.  
  47. 24:return x * y;   
  48.  
  49. 25: }   
  50.  
  51. 26:   
  52.  
  53. 27: void showResult(int res)   
  54.  
  55. 28: {   
  56.  
  57. 29:cout << "The result is: " << res <<end1;   
  58.  
  59. 30: }   
  60.  

C ++ originated from the C language. I still remember that it was a happy and full time to study C language a long time ago, the class is not added on the basis of C. If we think so, we are not good at C ++. Therefore, C ++ is never an upgrade or expansion of C. We should use C ++ as a new language to learn Bjarne Stroustrup, the father of C ++ ).

Write programs first expect that the program can be correctly executed, secondly, the efficiency can be accepted, and again, it is easy to maintain. C ++ is a difficult language to learn and use. C ++ provides many options, and there are four ways to think about using C ++ to write a program: process-based, Object-based, object-oriented, and generic.

All languages are just tools. It is important that you use the tool! In my personal experience, developers in the industry are willing to use mature and well-known technologies to complete their work. New users like to use some relatively new technologies for development, and they like to pursue novelty. It is easy to see from the interface that most of the colorful interfaces come from new users ). In fact, it is not a developer's fault to solve the problem by using some methods that may be inefficient, scalable, and difficult to maintain.

The above is a speech on the C ++ code. You are welcome to give more suggestions. It will be updated constantly and we hope you will have a lot of expectations.

  1. How to Write C ++ project development and project plan correctly
  2. Summary Notes on learning and exploring C ++ library functions
  3. In-depth demonstration of high security of C ++
  4. Describes in detail how to accurately Write C ++ languages.
  5. In-depth demonstration of high security of C ++

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.