char [length] initialization and dealing with it

前端 未结 5 1427
长情又很酷
长情又很酷 2021-01-28 08:42

I have defined a char array:

char d[6];

Correct me if I\'m wrong regarding following:

At this moment no memory is allocated for variabl

5条回答
  •  天涯浪人
    2021-01-28 09:14

    int d[6];
    

    6 bytes will be allocated onto the stack with this declaration. It will be freed automatically.

提交回复
热议问题