How to write C language with VS2022
Why use VS2022 to write C language
The full name of vs2022 is visual studio 2022, which is a new development and programming production tool produced by Microsoft. To put it simply, VS2022 is an IDE (Integrated Development Environment). For beginners like us, it is not recommended to toss the development environment by ourselves, so we can use VS2022 directly to get it right in one step, saving a lot of trouble. Otherwise, if you toss the development environment by yourself, it is easy to go from getting started to giving up.
Download of vs2022
Official website link
Select the community version.
How to use VS2022 to create a C language program
Check if the environment is complete
First open Visual Studio Installer
the software and click Modify.
Make sure that these two options have been installed, select them if they are not installed, and then click the modify option in the lower right corner, and wait for the installation to complete.
Create a .C source file
After we have installed VS2022, we can find the following two icons:
we can choose to open the software pointed by the red arrow.
The interface just opened is as follows
Click to create a new project.
test program
We write a test code:
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
It's ok to see this result!
Precautions:
1. Use of scanf function
VS does not support the scanf function. To use this function, we need to perform the following steps:
1. Use file search software (such as Everything , the hyperlink is a download link, you can directly download the installation package) to find newc++file.cpp
files.
2.
3. Copy the file to the desktop
4. Use Notepad to open the copied version of the file on the desktop.
5. Add the following paragraph
#define _CRT_SECURE_NO_WARNINGS 1
6. Save and launch, and then replace the original file.
This is done, and we can see that there is no error when the scanf function is used again!
2. Adjust the theme and font
The last point, teach you how to personalize your own VS2022.
Modify theme:
Modify font:
Summarize
VS2022 is a friendly IDE for novices, one step in place, although the software may be a little big, but its function is very powerful, we need to experience it slowly in the future!
I wrote a novice tutorial, mainly to teach you how to use VS2022. If you have any questions, I hope you can discuss them in the comment area and make progress together!