Question: are local variables initialized to zero by default in c?
Answer: The behaivour might change even with the same compiler depending on the compilation options and optimization level. Local non- static variables are not initialized -- which typically means they contain garbage. 0 is just as valid a garbage value as any other.