当前位置:网站首页>Take you to create your first C program (recommended Collection)
Take you to create your first C program (recommended Collection)
2022-07-25 15:27:00 【꧁ small ۣۖ Pigeon ۣۖ Puzi ۣۖ ิ꧂】
Knowing about console applications is usually knowing C# The first step in the application , It is a similar DOS The program of input and output in the interface of , It's learning C# The basic syntax of the program is the most convenient program .
Next, let's introduce how to create a console application .
Creating a console application is very simple , Choose in turn “ file ” One “ newly build ” One “ project ” command , The dialog box as shown in the following figure will pop up .
Choose among them “ Console Application ” Options , And set a name for the project 、 Location and solution name , single click “ determine ” Button to create a console application , The effect is shown below .
Note that the solution name is not necessarily the same as the project name , Multiple projects are allowed in the same solution .
As can be seen from the interface shown in the figure above, a new interface named Solution Solutions for , And in this solution, we created a project named Test Console application for .
stay Test The application contains a file called Program.cs Class files , The code in this file is shown in the figure below .
In this code, the 11 Go to the first place 13 Line is Main Method ,Main Method is a special method , And there can only be one in each class , Just write the code to Main In the method , After the project runs Main The code in the method will execute .
Apply on the console The method of outputting content in the console interface of the program is as follows .
Console.Write(); // Output content to the console interface without line break
Console.WriteLine(); // Line feed output content to the console interface
Now use the console application to output to the console “ first C# Program ” and “ This is a console application ”, The code for the implementation is as follows .
namespace test
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(" first C# Program ");
Console.WriteLine(" This is the first console program ");
}
}
}
Press Ctrl+F5 Key combinations run programs , The effect is shown below .

边栏推荐
- args参数解析
- JVM-动态字节码技术详解
- ML - 自然语言处理 - 自然语言处理简介
- How to solve the problem of scanf compilation error in Visual Studio
- 为什么PrepareStatement性能更好更安全?
- UIDocumentInteractionController UIDocumentPickerViewController
- IOS interview questions
- ML - 语音 - 语音处理介绍
- 记一次redis超时
- Single or multiple human posture estimation using openpose
猜你喜欢

Ml speech depth neural network model

NPM's nexus private server e401 E500 error handling record

使用cpolar建立一个商业网站(如何购买域名)

解决DBeaver SQL Client 连接phoenix查询超时

Idea远程提交spark任务到yarn集群

matlab---错误使用 var 数据类型无效。第一个输入参数必须为单精度值或双精度值

How much memory can a program use at most?

谷歌云盘如何关联Google Colab

Idea remotely submits spark tasks to the yarn cluster

Use the command to check the WiFi connection password under win10 system
随机推荐
Image cropper example
The difference between Apple buy in and apple pay
Rediscluster setup and capacity expansion
redis淘汰策列
args参数解析
数据系统分区设计 - 请求路由
Remember that spark foreachpartition once led to oom
Spark DF增加一列
盒子躲避鼠标
JVM garbage collector details
Single or multiple human posture estimation using openpose
Endnote 无法编辑range 解决
C#精挑整理知识要点9 集合2(建议收藏)
C language function review (pass value and address [binary search], recursion [factorial, Hanoi Tower, etc.))
苹果内购和Apple Pay 的区别
Submarine cable detector tss350 (I)
记一次redis超时
记一次Yarn Required executor memeory is above the max threshold(8192MB) of this cluster!
Word 样式模板复制到另一文档
ML - 语音 - 传统语音模型