Advertisement
mattparks5855

Hash Simple

Jul 17th, 2019
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.57 KB | None | 0 0
  1. // Raw pointers are prefixed by the raw keyword.
  2. // unique and shared act like std::unique_ptr and std::shared_ptr from C++.
  3. func main(argc: int, argv: raw char[]) -> int {
  4.     {
  5.         d := 42;
  6.         o := 052;
  7.         x := 0x2a;
  8.         X := 0X2A;
  9.         b := 0b101010;
  10.     }
  11.     {
  12.         x : raw int = new int(3);
  13.         y : unique float = new float(-1.86);
  14.         z : shared float64 = new float64(863.832987);
  15.         delete x; // y deleted at end of scope, z is deleted as-long as no references are held.
  16.     }
  17.  
  18.     a := 32;
  19.     b := 16;
  20.  
  21.     if ((a / 2) == b) {
  22.         puts("if1!\n")
  23.     }
  24.  
  25.     s := '"Hello World!"';
  26.     return a + b;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement