当前位置:网站首页>03.hello_ rust
03.hello_ rust
2022-06-28 20:12:00 【User 6532403】
first Rust Program .
- Create a directory first hello_rust.
- You can use handy editing (jetbrains Series can be installed rust plug-in unit , Or is it vscode Of rust All plug-ins are OK ).
- establish rust Source code file , It is to use .rs As an extension .
- stay hello.rs in , Input
fn main(){
println!("Hello Rust!")
}fn - Rust Language use fn Keywords define functions .main() Function is a predefined main function , act as Rust The entry point of the program , Every language has its own main() function . println!() yes Rust One of the languages Predefined macros . It is used to output the parameters passed to it to standard output .
notes :Rust In language macro with Exclamatory mark ( ! ) ending . See later with ! Similar function calls at the end , All are Macro call .Rust Provides a very powerful macro system , Through these macro , We can do it easily Metaprogramming .Rust Medium macro It's kind of like function . Can be macro Understood as a Enhanced version of function .
Use rustc hello.rs, Compile a to hello Binary executable with name
function ./hello, Screen output Hello Rust!
边栏推荐
- easypoi
- Pipeline | and redirection >
- How to obtain the coordinates of the aircraft passing through both ends of the radar
- Can layoffs really save China's Internet?
- On the first anniversary of the data security law, which four major changes are coming?
- 关键字long
- QSP read label configuration error
- rsync远程同步
- [go language questions] go from 0 to entry 5: comprehensive review of map, conditional sentences and circular sentences
- 数论 --- 欧拉函数、筛法求欧拉函数、欧拉定理、费马小定理详细证明
猜你喜欢

Parallax JS special effect JS carousel map plug-in

echart:横向柱状图的类目文字位置调整

Day88. qiniu cloud: upload house source pictures and user avatars

C#应用程序界面开发基础——窗体控制

Win 10 create a gin framework project

easypoi

How does redis implement inventory deduction? How to prevent oversold?

2022年P气瓶充装考试练习题及在线模拟考试

Markdown Mermaid planting grass (1)_ Introduction to Mermaid

计网 | 一文解析TCP协议所有知识点
随机推荐
28 rounds of interviews with 10 companies in two and a half years
酷学院华少:如何在SaaS赛道里做成一家头部公司
Grep text search tool
2. 整合 Filter
【学习笔记】因子分析
字符和整数
实型数运算
On the first anniversary of the data security law, which four major changes are coming?
Software supply chain security risk guide for enterprise digitalization and it executives
Severity code description project file line suppress status error lnk2038 detected a mismatch of "runtimelibrary": the value "md\u dynamicrelease" does not match the value "mdd\u dynamicde"
Rsync remote synchronization
H5 sunflower operation
Troubleshooting of pyinstaller failed to pack pikepdf
Quaternion quaternion and Euler angle transformation in ROS
5g NR MBS architecture introduction
2280.Cupboards
csdn涨薪技术-Selenium自动化测试全栈总结
wc命令的使用
请允许当下国内ToB的「不完美」
Jenkins pipeline's handling of job parameters