Initializing an array with a trailing '\0'

前端 未结 0 1495
难免孤独
难免孤独 2021-01-18 05:30

I find myself doing the following quite a bit:

char vals[count+1];
vals[count+1] = \'\\0\';

Is there a simpler way to do this initialization

相关标签:
回答
  • 消灭零回复
提交回复
热议问题