Per te pare cap dhe len ne ndryshime dhe mbishkrim jasht v

fn main(){
    let  s = String::new();
    let mut s1 = s;
    s1.push_str("hello");   
    s1.push_str(  " sot keni dale mire keni marre ? ");
    s1.push_str("!");
    
    
   
    let mut  v = Vec::new();
    v.push(10);
    println!(" {:?} ", v);
    let mut s2 = String::from(" pershendetje ");
    s2.push_str(" sot keni mare !");
    println!(" {} ", s2);
    v.push(4);
    
    
    let p = v.as_mut_ptr();
    unsafe{
        
        let p1 = p.add(1);
        *p1 = 5;
    println!(" {} ", *p1);
    
        println!(" s1 e ka cap {} ", s1.capacity());
        println!(" s1 e ka gjatesin {} ",s1.len() );
        println!(" v e ka cap {} ", v.capacity());
        println!("  v e ka gjatesi {} ", v.len());
        println!(" s2 cap {} ", s2.capacity());
        println!(" s2 gjatesia {} ", s2.len());
        let b = Box::new(999);
        let ptr = Box::into_raw(b);
        let b1 = Box::from_raw(ptr);
        println!(" {} ", *ptr);
        *ptr = 000;
        println!(" {}", *ptr);
        println!(" adresa e ptr {:p} ", ptr);
        println!(" adres aq e p eshte {:p} ", p);
     let mut v = Vec::with_capacity(100);
     v.push(20);
     v.push(10);
     let p7 = v.as_mut_ptr();
     println!(" v eshte {:?} ", v);
     *p7 = 2000;
     println!(" p6 {} ", *p7);
     let p7_larg = p7.add(15000);
     *p7_larg = 999;
     println!("vkera ne p7_larg  {} ", *p7_larg);
     println!(" add e p7_large eshte {:p} ", p7_larg);
     }
     
    }
    
    
    

(Playground)

Hi and welcome to the Rust users forum. It looks like you have found the option to share code from the rust Playground here. Usually, you should use this with some code you wrote yourself and have questions about or need help with. If you do so, also make sure to add a problem description or question to your post.

Like this there is no code and no question for anyone to react to. Feel free to come back to this forum with any actual problem or question you have and can't easily find the answer to. Meanwhile, have fun with the Rust programming language - cheers :slight_smile: