官术网_书友最值得收藏!

Main function

Let's look again at our first project source code:

fn main() {
    println!("Hello, world!");
}

It only contains a main function—this is where the execution of the program begins. It is a function that takes no arguments (hence the empty parentheses) and returns a unit, also written (). The body of the function, between curly brackets, contains a call to the println!() macrowe can see this is a macro because it ends with !, as opposed to a function. This macro prints the text between parentheses, followed by a new line. We'll see what is a macro in the Macros section.

主站蜘蛛池模板: 搜索| 阿拉善右旗| 镇安县| 民乐县| 疏附县| 本溪市| 阿克苏市| 自贡市| 林口县| 绍兴市| 广平县| 车致| 庆城县| 桓台县| 水城县| 搜索| 镇赉县| 筠连县| 康乐县| 河北省| 湘西| 玉山县| 江川县| 祁连县| 宜春市| 吴堡县| 灵武市| 崇文区| 鹤岗市| 光山县| 卫辉市| 洪江市| 巫溪县| 上林县| 原阳县| 拉萨市| 师宗县| 班玛县| 江川县| 封丘县| 迁安市|