Non null-terminated string compiler option for gcc
turns out this is just another case of "c++ is not c blues"
What I want
const char hex = "0123456789ABCDEF";
the only thing that works
char hex = "0123456789ABCDE"; hex = "F";
are there any compiler options or something I can do to make strings not null terminated in the gcc compiler. so that I can make a(n) constant array
No need for a compiler option, it's already non-NUL terminated. The standard says a NUL should only be added if it can fit, otherwise it would be an overflow. It may just be that the next byte in memory past your array is \0
§ 6.7.8p14 An array of character type may be initialized by a character string literal, optionally enclosed in braces. Successive characters of the character string literal (including the terminating null character if there is room or if the array is of unknown size) initialize the elements of the array.