Advertisement
Guest User

Untitled

a guest
Apr 14th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const std = @import("std");
  2.  
  3. pub const A = packed struct {
  4. a: u8,
  5. b: u24,
  6. };
  7.  
  8. pub const B = packed struct {
  9. b: u24,
  10. a: u8,
  11. };
  12.  
  13. pub fn main() !void {
  14. const stdout = std.io.getStdOut().writer();
  15. try stdout.print("@sizeOf(A) = {}; @sizeOf(B) = {}", .{ @sizeOf(A), @sizeOf(B) });
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement