Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Area {
- width: i32,
- height: i32
- }
- fn main(){
- // Instanciamos un struct Area
- let area = Area{width: 100, height: 200};
- // Accedemos a sus propiedades mediante .
- println!("Width is {}", area.width);
- //OUTPUT Width is 100
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement