Compound Types Example

fn main() {

    // Tuple
    
    let x: (i32, f64, u8) = (500, 6.4, 1);
    
    let five_hundred = x.0;
    
    println!("five_hundred is {}.", five_hundred);
    
    let six_point_four = x.1;
    
    println!("six_point_four is {}.", six_point_four);


    //Array

    let week_days: [&'static str; 7] = [
        "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"
    ];

    // Note the question mark!
    println!("week_days are {:?}.", week_days);

    
    // Invalid array element access
    // Uncomment to see the error
    // let idx: usize = "7".parse().unwrap();
    // println!("Eighth day is {}.", week_days[idx]);
    
    
    // Initialization
    
    let y = [3; 5];
    
    println!("y is {:?}.", y);
}