Pretty much, you can't - in C, a null character is considered a string terminator - encountering one marks the end of the string.
If you want to include nulls in your data, you should be using
unsigned char
datatypes, and not trying to use "string based shortcuts" like this:
char chars[] = "0123456789abcdef";
as it adds an addition null to the end of the array.
I'd probably recommend using
#define
to make it obvious:
#define byte unsigned char
...
byte data[noOfBytesNeeded];
Then treat your data as an array of values and print each as a character separately yourself instead of type to con the system into thinking it's a string.
But do be aware that a null character '\0' will print as nothing at all - not even a gap or space between the character before and after as it is defined by the C specification as a Control Character and thus unprintable! The only time you will be able to "see" it is if you print it to a file and use a hex editor to examine the file data.
What are you trying to do that you think you need this?