本文簡要介紹rust語言中 Macro std::println 的用法。
用法
macro_rules! println {
() => { ... };
($($arg : tt) *) => { ... };
}使用換行符打印到標準輸出。
在所有平台上,換行符都是 LINE FEED 字符(\n /U+000A)(沒有額外的回車(\r /U+000D))。
使用 format! 語法將數據寫入標準輸出。有關詳細信息,請參閱 std::fmt 。
僅將println! 用於程序的主要輸出。改用 eprintln! 來打印錯誤和進度消息。
Panics
如果寫入 io::stdout 失敗,則會出現Panics。
例子
println!(); // prints just a newline
println!("hello there!");
println!("format {} arguments", "some");相關用法
- Rust print用法及代碼示例
- Rust pointer.offset_from用法及代碼示例
- Rust park用法及代碼示例
- Rust pointer.is_null用法及代碼示例
- Rust pointer.add用法及代碼示例
- Rust pointer.get_unchecked用法及代碼示例
- Rust pointer.align_offset用法及代碼示例
- Rust pointer.wrapping_add用法及代碼示例
- Rust pointer.wrapping_offset用法及代碼示例
- Rust pointer.wrapping_sub用法及代碼示例
- Rust poll_fn用法及代碼示例
- Rust pointer.as_uninit_ref用法及代碼示例
- Rust pointer.len用法及代碼示例
- Rust pointer.get_unchecked_mut用法及代碼示例
- Rust pointer.sub用法及代碼示例
- Rust panicking用法及代碼示例
- Rust panic用法及代碼示例
- Rust pointer.set_ptr_value用法及代碼示例
- Rust pointer.as_ptr用法及代碼示例
- Rust pointer.as_mut_ptr用法及代碼示例
- Rust pending用法及代碼示例
- Rust pointer用法及代碼示例
- Rust pointer.offset用法及代碼示例
- Rust pointer.as_mut用法及代碼示例
- Rust park_timeout用法及代碼示例
注:本文由純淨天空篩選整理自rust-lang.org大神的英文原創作品 Macro std::println。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
