In C and C++, regular character strings are terminated by a '\0'
character. So it appears you are using a string function to copy the data. That is, it stops copying once it hits the '\0'
value.
Interestingly, you left the part that copies the data (and maybe just the part the displays the data) out of your question. So we can’t tell you which function that is. But we can see that’s what’s happening.
solved C++ How can i build byte arrays?