Zeroing Memory is Hard (VC++ 2015 arrays)--Bruce Dawson

Here is a curious behaviour:

Zeroing Memory is Hard (VC++ 2015 arrays)

by Bruce Dawson

From the article:

Quick, what’s the difference between these two C/C++ definitions of initialized local variables?

char buffer[32] = { 0 };
char buffer[32] = {};

One difference is that the first is legal in C and C++, whereas the second is only legal in C++.

Okay, so let’s focus our attention on C++. What do these two definitions mean?

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.