vendredi 29 mai 2015

Why printf is not printing garbage value?

#include<stdio.h>
void foo(){
int i;
printf("%d\n",i);  //should print garbage value
}
void main(){
foo();
}

foo should print garbage value of i. But instead it is printing zero. Why is that? I am using gcc version 4.9.2.

Aucun commentaire:

Enregistrer un commentaire