mardi 27 décembre 2022

Is this undefined behavior? why does this code return a seemingly random integer?

I'm looking at the following C code:

#include <stdio.h>
#include <stdlib.h>

void main(){
    int a;
    printf("%d", a);

}

I'm wondering why this code prints a seemingly random number. My first guess is that this is undefined behavior but I could be wrong.




Aucun commentaire:

Enregistrer un commentaire