4fc0452ace
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
17 lines
372 B
Rust
17 lines
372 B
Rust
#[feature(managed_boxes)];
|
|
|
|
pub fn main() {
|
|
let v: ~[int] = ~[ 1, ..5 ];
|
|
println!("{}", v[0]);
|
|
println!("{}", v[1]);
|
|
println!("{}", v[2]);
|
|
println!("{}", v[3]);
|
|
println!("{}", v[4]);
|
|
let v: @[int] = @[ 2, ..5 ];
|
|
println!("{}", v[0]);
|
|
println!("{}", v[1]);
|
|
println!("{}", v[2]);
|
|
println!("{}", v[3]);
|
|
println!("{}", v[4]);
|
|
}
|