C++ Getting Started Guide and the first step in actual combat overview and classic HelloWorld

The environment and learning threshold of this series of articles

  • Programming basics: none
  • Age: Have a certain logical thinking
  • English: Not required
  • Mathematics: Not required
  • Length of study: one article per day, 4-5 articles a week, each article can be up to 1 hour
  • Rote memorization: No need, understanding is paramount
  • Native environment: Windows7 SP1
  • Software used: devc

Note: All the unintelligible terms that appear below do not need to be understood. They are used as popular science and will be explained later when used. If you have any unclear questions, you can leave a message in the comment area or chat privately.

Brief introduction

In today's popular programming languages, each programming language has advantages in its own field that other languages ​​cannot replace. With its outstanding efficiency and flexibility, C++ is one of the best choices in some application scenarios; such as games, PC software, etc.

C++ was developed by Bjame Sgoustrup in 1979 (C with classes: C with classes), and was officially named C++ (C plus plus) in 1983. C++ is developed on the basis of the C language and retains the characteristics of the C language (backwards compatible with C).

C++ is different from some commonly used programming languages. C++/C are both low-level languages. Low-level language does not mean that the language is not good, but that the form of the language is close to machine language (it is troublesome to use but very flexible). Low-level languages ​​are generally closer to the bottom of the system, such as operating memory, managing space, etc., in other words, it means that you have to implement a requirement to complete a software, and you must implement it yourself from beginning to end. Because of this feature, the development efficiency of low-level languages ​​is extremely slow. And there will be unexpected bugs, but the operating efficiency is indeed very efficient.

Interpretation: ①Low-level language refers to the language that is closer to the bottom of the system, and the way of thinking will consider more, you need to think like a computer how to complete the whole logic, use complex methods, etc.; ②High-level language such as python, easy to use, when used Do not need to think too much, just like human natural language to write programs.

Classic HelloWorld program

The HelloWorld program generally refers to writing code to display HelloWorld after completing a program.
In order to facilitate the learning of zero-based novices, the software used here is devc. First open devc, click New (file) and select Source File: The
Insert picture description here
above step means to create a new source file (source file generally refers to a code file). Then a work area appears, as shown below: At
Insert picture description here
this time, we can start writing our program code in the purple area, and then we copy the following code to the work area:

#include<iostream>
using namespace std;

int main(){
    
    
	cout <<"Hello World";
	return 0;
}

Insert picture description here

Then click File and select Save to save:
Insert picture description here
In the pop-up save location selection dialog box, select the save location, and fill in the file name, the save type is C++ source file, and then click Save.
Insert picture description here
Select the arrow as shown in the toolbar, or press F11 on the keyboard to run the program and successfully display HelloWorld: The
Insert picture description here
next section will explain the HelloWorld program and some knowledge supplements.

Guess you like

Origin blog.csdn.net/A757291228/article/details/107432163