当前位置:网站首页>Learning C language today is the first time to learn C language. In college, C linguistics is not good, but I want to make progress, so I found a beep video on the Internet to learn C language
Learning C language today is the first time to learn C language. In college, C linguistics is not good, but I want to make progress, so I found a beep video on the Internet to learn C language
2022-06-25 15:05:00 【108 rings 02】
First we learn to use visual2017, I use 2017, We first learn how to use this software .
First we open a file —— newly build —— project 
We click on the icon once

Then we need to find the Solution Explorer , You can find it in the view , The first one is .

Right click the source file , Click new item 
We click c++ Please note that the following names must be used .cpp, Click ok
Then we can write the program , The first program I wrote was learned from watching the video , The contents are as follows

here main It's the main function ,C The language program is executed from main The first line of the function starts executing , there printf Function is a library function , We can print the characters we want to output on the public screen . Our computers do not have this function , So we need a header file called stdio.h Find this library file in the header file of . We can use #include<> Method to include this header file .int Is the return function type ,main Is the function name , Brackets {} The content in is the function body . After we have written it, we need to run the program , We can do that by using ctrl+f5 The way to run .
Some versions of visual studio Because of the direct operation, we will not see the results of the operation , But that doesn't mean the computer isn't running , We can find the Solution Explorer as shown in the picture , Right click on our project , Find the system of the connector in the properties , Click the console in the subsystem ( my visual studio2017 The default is console )

It is worth noting that there is only one in a project main function , Multiple... Are not allowed main function , because main The function is equivalent to a vertical entry , When there are multiple vertical entrances in our project, the computer program does not know which one to enter from, so it will report an error , There can be more than one in a project .c Program , But many .c There can only be one in the program main function .

So that's the end of the first program , At the end of writing the program, I found a problem , I don't understand why there should be one return function , And why in return Followed by 0 Well , I'll start with 0 Change to 1, Discovery works , The only difference is that the return code is 0 Changed to 1. Later, I tried a few more numbers and found that they were all OK , Add more in the middle space Spaces are also OK , Even delete return 0 It's OK, too , But you can't change it into letters . So I looked up the information on the Internet .

What I mean here is return A function is when we run a program , Internal functions return You can exit the function and set the value to the number we need .return 0 The return value is 0,,return The return value is 1. That's all for today's study , I hope we'll see you next time , I hope I can stick to it all the time .
边栏推荐
- 14 -- validate palindrome string II
- [HBZ sharing] use of locksupport
- 定位position(5种方式)
- What is the difference between escape, encodeuri and encodeuricomponent?
- 买卖股票的最佳时机
- 【Try to Hack】vulnhub DC1
- How to cut the size of a moving picture? Try this online photo cropping tool
- Qmake uses toplevel or topbuilddir
- Automatic correlation between QT signal and slot
- Single user mode
猜你喜欢

Flexible layout (display:flex;) Attribute details

QQ情话糖果情话内容获取并保存

Using Sphinx to automatically generate API documents from py source files

从0到1完全掌握 XSS

Open a restaurant

JGG | overview of duhuilong group of Hebei University Research on plant pan genomics

多张动图怎样合成一张gif?仅需三步快速生成gif动画图片

From 408 to independent proposition, 211 to postgraduate entrance examination of Guizhou University

System Verilog — interface

How to cut the size of a moving picture? Try this online photo cropping tool
随机推荐
QT pop up open file dialog box QFileDialog
Flexible layout (display:flex;) Attribute details
[try to hack] vulhub shooting range construction
15 -- 最接近原点的 K 个点
Daily question, magic square simulation
【中国海洋大学】考研初试复试资料分享
C language LNK2019 unresolved external symbols_ Main error
Source code analysis of zeromq lockless queue
System Verilog - thread
Introduction to flexible array
@Font face fonts only work on their own domain - @font-face fonts only work on their own domain
Build a minimalist gb28181 gatekeeper and gateway server, establish AI reasoning and 3D service scenarios, and then open source code (I)
定位position(5种方式)
Yolov3 spp Darknet version to caffemodel and then to OM model
开餐馆
About?: Notes for
90 后眼中的理想 L9:最简单的产品哲学,造最猛的爆款 | 指南斟
Design and implementation of timer
Go closure usage example
Biscuit distribution