This is just an initialization list for an array. So this is very similar to the usual syntax:
char buf[5] = { 1, 2, 3, 4, 5 };
However, the C standard states that if you do not provide a sufficient number of elements in the list of initializers, it will by default initialize the rest. This way, in your code, all elements bufwill be initialized to 0.
printfIt doesn’t display anything, because it bufis a string of zero length.
source
share