I thought by setting the first element to a null would clear the entire contents of a char array.
char my_custom_data[40] = \"Hello!\"; my_custom_data[0] = \
You should use memset. Setting just the first element won't work, you need to set all elements - if not, how could you set only the first element to 0?