What happens if I write less than 12 bytes to a 12 byte buffer?
Understandably, going over a buffer errors out (or creates an overflow), but what happens if there are less than 12 bytes used in a 12 byte buffer? Is it possible or does the empty trailing always fill with 0s? Orthogonal question that may help: what is contained in a buffer when it is instantiated but not used by the application yet? I have looked at a few pet programs in Visual Studio and it seems that they are appended with 0s (or null characters) but I am not sure if this is a MS implementation that may vary across language/ compiler. Consider your buffer, filled with zeroes: [00][00][00][00][00][00][00][00][00][00][00][00] Now, let's write 10 bytes to it. Values incrementing from 1: [01][02][03][04][05][06][07][08][09][10][00][00] And now again, this time, 4 times 0xFF: [FF][FF][FF][FF][05][06][07][08][09][10][00][00] what happens if there are less than 12 bytes used in a 12 byte buffer? Is it possible or does the empty trailing always fill with 0s? You write as much as...