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

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.

主站蜘蛛池模板: 玉龙| 姚安县| 轮台县| 富阳市| 宿松县| 兖州市| 通渭县| 麻栗坡县| 平乡县| 平乡县| 和田县| 广西| 大兴区| 苗栗市| 香格里拉县| 贡山| 防城港市| 富宁县| 阳朔县| 宁都县| 安国市| 西华县| 屏南县| 山西省| 亳州市| 江油市| 石家庄市| 内黄县| 蓬溪县| 定边县| 凤阳县| 黄石市| 乳源| 隆尧县| 缙云县| 乾安县| 新丰县| 广昌县| 诸城市| 西畴县| 南充市|