Some C or C++ programmers are surprised to find out that even storing an invalid pointer is undefined behavior. However, for heap or stack arrays, it\'s okay to store the a
You could define c as an array of size 1:
char c[1] = { 'X' };
Then the undefined behavior would become defined behavior. Resulting code should be identical.