当前位置:网站首页>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 .

边栏推荐
猜你喜欢

Idea eye care settings

Application of C language array in Sanzi chess -- prototype of Queen n problem

Spark memory management mechanism new version

Single or multiple human posture estimation using openpose

Node learning

ML - 语音 - 语音处理介绍

ML - 语音 - 高级语音模型

MATLAB读取显示图像时数据格式转换原因

小波变换--dwt2 与wavedec2

记一次Spark foreachPartition导致OOM
随机推荐
HDU3873-有依赖的最短路(拓扑排序)
Vscode plugin collection
Graph theory and concept
UIDocumentInteractionController UIDocumentPickerViewController
Spark AQE
JVM-垃圾收集器详解
Node learning
ios 面试题
2019陕西省省赛K-变种Dijstra
JVM parameter configuration details
Iframe nested other website page full screen settings
获取键盘按下的键位对应ask码
IOS interview questions
Spark sql 常用时间函数
Spark SQL空值Null,NaN判断和处理
Xcode added mobileprovision certificate file error: Xcode encoded an error
看到很多App出现闪烁的图片,特别是会员页面
小波变换--dwt2 与wavedec2
Spark AQE
BPSK调制系统MATLAB仿真实现(1)