Yes, all members of a
are guaranteed to be initialised to 0.
From section 3.5.7 of the C89 standard
If an object that has static storage duration is not initialized
explicitly, it is initialized implicitly as if every member that has
arithmetic type were assigned 0 and every member that has pointer type
were assigned a null pointer constant.
Related Contents:
- How do I use extern to share variables between source files?
- How can I access a shadowed global variable in C?
- When is it ok to use a global variable in C?
- Why can’t I assign values to global variables outside a function in C?
- Why can’t I create an array with size determined by a global variable?
- Printing all global variables/local variables?
- shared global variables in C
- Global variables in C are static or not?
- Why can I define a variable twice in C?
- Finding the address range of the data segment
- What will be the output of this? Please explain it also [closed]
- Prime Factorisation + prime number in C
- Sort words in a string based on their vowel number
- What does
- Why does GCC use multiplication by a strange number in implementing integer division?
- Why does scanf ask twice for input when there’s a newline at the end of the format string?
- What are the valid signatures for C’s main() function?
- Is 2d array a double pointer? [duplicate]
- Why does sizeof(x++) not increment x?
- Assigning strings to arrays of characters
- How to prevent scanf causing a buffer overflow in C?
- Alternative (K&R) C syntax for function declaration versus prototypes
- Why is sizeof considered an operator?
- What’s the difference between “static” and “static inline” function?
- Where you can and cannot declare new variables in C?
- How does fread really work?
- Determining endianness at compile time [duplicate]
- C – why is strcpy() necessary
- How to generate random float number in C
- What does i = (i, ++i, 1) + 1; do?
- Explain the order of evaluation in printf [duplicate]
- In C, do braces act as a stack frame?
- Fixed Point Arithmetic in C Programming
- What’s the difference between logical SSE intrinsics?
- In C, given a variable list of arguments, how to build a function call using them?
- How to use the addr2line command in Linux?
- Why does “memset(arr, -1, sizeof(arr)/sizeof(int))” not clear an integer array to -1?
- Using memset for integer array in C
- How to portably print a int64_t type in C
- C: correct usage of strtok_r
- Do forked child processes use the same semaphore?
- fflush(stdin) function does not work
- How to find the socket connection state in C?
- How is conversion of float/double to int handled in printf?
- No loop condition in for and while loop
- How to properly add hex escapes into a string-literal?
- Simple swap function…why doesn’t this one swap?
- How to compile an MPI included c program using cmake
- Is it possible to print out only a certain section of a C-string, without making a separate substring?
- C – freeing structs