No, in the test case, A = 40 means [0u8; 40] that also means 40 bytes, and B = 2 which is [0u8; 2] that's 2 bytes, which is total of 42 bytes.
A = 40
[0u8; 40]
40 bytes
B = 2
[0u8; 2]
42
Ah indeed, thanks! I misunderstood the syntax.
edit : that's a really smart solution btw, thanks for sharing
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
No, in the test case,
A = 40
means[0u8; 40]
that also means40 bytes
, andB = 2
which is[0u8; 2]
that's 2 bytes, which is total of42
bytes.Ah indeed, thanks! I misunderstood the syntax.
edit : that's a really smart solution btw, thanks for sharing