The initialization order of free objects is undefined in C ++. But what about the following?
namespace foo { char const* str = "hey"; struct A { A() { cout << str; } } obj; }
Is this still undefined behavior or is there a special provision for pointers initialized with string literals?
Besides this : what if str is of type "char const []"? And if it was std :: string?
Iraimbilanja
source share