Skip to content

Instantly share code, notes, and snippets.

@vimishor
Created September 5, 2018 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vimishor/cae70fe931695f20f394722140f40b6c to your computer and use it in GitHub Desktop.
Save vimishor/cae70fe931695f20f394722140f40b6c to your computer and use it in GitHub Desktop.
pub const Box = struct {
field: i32,
};
pub fn main() void {
var box = Box { .field = 0 };
box.*.field = 1; // crash aici
var boxPtr = &box;
boxPtr.*.field = 1; // si aici
boxPtr.*.*.field = 1; // si aici
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment