Почему этот массив символов должен быть статическим?C++

Программы на C++. Форум разработчиков
Anonymous
Почему этот массив символов должен быть статическим?

Сообщение Anonymous »

Код: Выделить всё

const char * u8_to_bstr(const uint8_t & u8) {
static char s[9];   // space for 8-char string
s[8] = 0;           // terminate string
char * sp = s;
for (uint8_t xbit = 0b10000000; xbit > 0; xbit >>= 1) {
cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/69608300/why-does-this-char-array-need-to-be-static[/url]

Вернуться в «C++»