Table of contents
Preface
Hello everyone, the C language I learned in college was poor and the system was insufficient. Now I have decided to relearn C language and make learning C language less boring by blogging in an interesting and lively way.
1. Why should you learn C language?
As we all know, if you want to become advanced, you must lay a solid foundation, and C language is the beginning of the programming world. Language, as the name suggests, is used for communication, and C language mainly allows us to communicate with computers. After learning the C language, it will be easier to practice other higher-level skills such as C++, Java, and python in the future.
2. Preparation before studying
If a worker wants to do a good job, he must first sharpen his tools. Choosing a good compiler can help us advance faster. I choose Visual Studio 2022, and you can choose the compiler you are familiar with.
2.1 Download, install and use
First open the browser and enter "visual studio", as shown
below. Click on the website above to enter the following page
Just choose the 2022 community version to download. The installation is based on your own needs. I choose the C++ platform, and the default installation location is fine. If the capacity of the C disk is not enough, only the location of the disk will be changed, and the names of other files will not be changed. If you need more details, you can search by yourself. Attached is a VS2022 installation tutorial I have watched . After downloading, click the VS2022 icon to enter the following interface.
Then click Create a new project to enter an interface like this:
Select C++ and click on the empty project. Create a project as shown below
After we click on the source file, move the mouse to Add and click New Item.
Click below to create the file.
Then we can start practicing programming.
2.2 Gitee and GitHub
Github and Gitee are websites where people upload codes abroad and domestically respectively. Since Github login is slow, it is recommended to use Gitee.
3. Data type
symbol | name |
---|---|
char | character data type |
short | short integer |
int | integer |
long | long integer |
long long | longer integer |
float | Single precision floating point number |
double | Double precision floating point number |
4. The first C language program
#include<stdio.h>
int main(){
printf("我要无敌\n");
return 0;
}
The first line is the imported header file, which provides the printf function. The second line int indicates that the return value is an integer, and the main function is the entry point of the program.
5. Summary
Keep working hard and start from the shallower to the deeper. I believe you can learn C language well.