Some suggestions for newbies who use Visual Studio 2017 to learn C language

If you are a guy who wants to learn C language through C Primer Plus and Visual Studio2017 . Here are some suggestions.

1. Be sure to use the .c suffix when creating source files . The system will determine the source file type based on the source file suffix. If the suffix uses the default .cpp, VS will use the C++ compiler. You may find at the beginning that the C++ compiler can indeed compile C. But in fact it is not entirely possible. (You will find that your compiler reports an error when you learn compound literals) .c suffix setting source file
2. If you use the scanf function to report an error. In fact, the SDL check of VS is turned on (you can find a bunch of methods on the Internet). When creating a project, you can choose to close the SDL check by selecting the installation wizard when creating the project.
Choose Windows Desktop Wizard

3. VS2017 does not support variable length arrays.

4. When using VS to open a file in a C program, it is indeed possible to only give the file name. But if the directory where the file is located is the working directory during debugging . Similarly, if the program creates a new file, the directory of the file is also in the working directory. The working directory is the solution folder by default. Also in debugging, you can set command line parameters for the project in the command parameter bar . 5. If you find that the program does not follow the scheduled program. Mostly you typed fewer parentheses or more semicolons. Observe carefully whether there are similar problems. Make mistakes to make progress .
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_37856544/article/details/86689358