Choose a weapon
If a worker wants to do something good, he must first sharpen his tools. It is important to choose a good and popular programming tool. Software programming tools are now called IDEs—the integrated development environment that can do a lot for us. Some people are willing to manually write the makefile to manage the source files themselves, which is very good, but the makefile is as easy for the novice as the Tianshu, and it is easy to be hit without interest. Should the makefile be learned? should! However, the learning time should be after completing a more complicated project. At this time, the organization of the project, source code management, dependencies, etc. have a certain understanding, and then learning the makefile will go smoothly. So we are still honestly choosing an IDE. Support for cross-platform IDEs are: QtCreator, Code::Blocks, Dev C++, eclipse CDT, Netbeans, etc. But the best use, in my many years of experience, the first push QtCreator, I don't want to worry too much, you will know it yourself, anyway, it is free.
QtCreator installation
QtCreator has the same interface on all three platforms. But QtCreator has a problem under Chinese Windows, the console Chinese garbled. The console program you create is garbled when it outputs Chinese. Since QtCreator's default encoding for source files is UTF8, and the character encoding in the console is interpreted according to GB2312, it is messy. To eliminate it is also very simple, change the source code to GB2312. Or do not output Chinese characters. As shown below:
First program
Wan Hao Gaotai, starting from the ground. To become a C++ master, you have to start with C. To write a program, first build a C project, the following figure is a built QTCreator project:
You can see that there are already several files in a simple project. The pro file is a project file that is used to save project information. Do not move it. The Sources folder is not a real folder, just a grouping. Main.c is the source file. The main.c file is not empty, but a HelloWorld program. This is what the IDE does for us. You can delete the file and add it again. The effect is the same. This program does one thing: output a piece of text: Hello world. But from this program you can see the essential elements of a program:
At least one C file.
There is at least one main function in the C file.
Content in main.c:
//Include this header file in order to use the function printf, otherwise you don't need to include this header file #include
Core grammar:
Comments are for people to see, and the compiler does not treat them as code. Single line comment ://, multi-line comment: /**/.
A line of statements ends with a semicolon.
The include clause is called a header file. The header file is included to use the function or variable declared in that header file.
Main is a function, and the braces are the code of the function. Code is the instruction that a computer can execute.
The output text is done by the printf function, which is the function in the stdio.h file, so you must include the header file before using printf.
This function must be called to use the function of a function, such as printf.
The function can be called any number of times, for example you can call printf 10 times.
The calling function is written with certain rules. First, write the function name. Because there is no function name, you don't know which function to execute. The function name is followed by the parentheses. The parameters in the parentheses are called parameters. What parameters are passed here, what printf outputs.
4 In 1 Wireless Data Charging Cable
Mobile Phone Charging Usb Adapter Cable For iPhone
Five lengths
Each pause is a length, suitable for multiple occasions
Notice
Both cables are stretched at the same time
Do not stretch unilaterally
dual-use, small portable, easy to take durable
flexible length adjustment
Guangzhou HangDeng Tech Co. Ltd , http://www.hangdengtech.com