• Читалка
  • приложение для iOs
Download on the App Store
  • Читалка
  • приложение для Android
Get it on Google Play

«Rust by Example»

230

Описание

https://doc.rust-lang.org/stable/rust-by-example/

2 страница из 184
читать на одной стр.
Настроики
A

Фон текста:

  • Текст
  • Текст
  • Текст
  • Текст

Шрифты

  • Аа

    Roboto

  • Аа

    Garamond

  • Аа

    Fira Sans

  • Аа

    Times

  • Аа

    Iowan

  • Аа

    San Francisco

  • Аа

    SF Serif

  • Аа

    New York

  • Аа

    Helvetica Neue

  • Аа

    Arial

  • Аа

    Georgia

  • Аа

    Times New Roman

  • Аа

    Courier

  • Аа

    Courier New

  • Аа

    Menlo

  • Аа

    SF Mono

стр.

      • // Line comments which go to the end of the line.

      • /* Block comments which go to the closing delimiter. */

   • Doc comments which are parsed into HTML library documentation:

      • /// Generate library docs for the following item.

      • //! Generate library docs for the enclosing item.

fn main() {

// This is an example of a line comment

// There are two slashes at the beginning of the line

// And nothing written inside these will be read by the compiler

// println!("Hello, world!");

// Run it. See? Now try deleting the two slashes, and run it again.

* This is another type of comment, a block comment. In general,

* line comments are the recommended comment style. But

* block comments are extremely useful for temporarily disabling

* chunks of code. /* Block comments can be /* nested, */ */

* so it takes only a few keystrokes to comment out everything

* in this main() function. /*/*/* Try it yourself! */*/*/

Note: The previous column of `*` was entirely for style. There's

no actual need for it.

// You can manipulate expressions more easily with block comments

// than with line comments. Try deleting the comment delimiters

// to change the result:

let x = 5 + /* 90 + */ 5;

println!("Is `x` 10 or 100? x = {}", x);

הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Library documentation

Formatted print

Printing is handled by a series of macros defined in std::fmt some of which include:

   • format!: write formatted text to String

   • print!: same as format! but the text is printed to the console (io::stdout).

Комментарии к книге «Rust by Example», Collective of authors

Всего 0 комментариев

Комментариев к этой книге пока нет, будьте первым!

РЕКОМЕНДУЕМ К ПРОЧТЕНИЮ

Популярные и начинающие авторы, крупнейшие и нишевые издательства