Basic Syntax
๋๋ถ๋ถ์ ๋ฌ์คํธ ๋ฌธ๋ฒ์ C/C++๊ณผ ์ ์ฌํฉ๋๋ค.
- ๋ธ๋ก๊ณผ ์ค์ฝํ ๋ฒ์๋ ์ค๊ดํธ
{}
๋ก ํํํฉ๋๋ค. - ์ธ๋ผ์ธ ์ฃผ์์
// ...
, ๋ธ๋ก ์ฃผ์์/* ... */
๋ก ์ฌ์ฉํฉ๋๋ค. if
๋while
๊ฐ์ ํค์๋๋ ๋์ผํฉ๋๋ค.- ๋ณ์ ํ ๋น์
=
, ๋น๊ต๋==
๋ฅผ ์ฌ์ฉํฉ๋๋ค.
Much of the Rust syntax will be familiar to you from C or C++:
- Blocks and scopes are delimited by curly braces.
- Line comments are started with
//
, block comments are delimited by/* ... */
.- Keywords like
if
andwhile
work the same.- Variable assignment is done with
=
, comparison is done with==
.