I've seen two different ways to fill a char[]
with 0
(in this example, upon initialization):
/* method 1 */
char foo[1024] = {0};
/* method 2 */
char foo[1024];
memset(foo, '\0', sizeof(foo));
What are the main differences between the two codes? How do they differ in functionality, etc?