Advertisement
cwchen

[Rust] Point class demo

Aug 28th, 2017
3,542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.13 KB | None | 0 0
  1. struct Point {
  2.     x: f64,
  3.     y: f64
  4. }
  5.  
  6. fn main() {
  7.     let p = Point{ x: 3.0, y: 4.0 };
  8.  
  9.     println!("({}, {})", p.x, p.y);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement