Console printing

When you need to lock the standard I/O interface, then write bytes to it, and finally flush it for each call, the print!() and println!() macros allow you to do that by just giving them a formatting static string and a series of parameters. Not only that, you can use the whole std::fmt module to specify number precision, format things in debug mode, and so on.

Similar macros exist for the standard error output interface or stderr. They are called eprint!() and eprintln!(), and allow you to easily print in stderr with the same format as print!() and println!(). The four macros use the syntax from the format!() macro, which we will see next.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.51.157