void myFunction() {
// Local variable that belongs to myFunction
int x = 5;
}
int main() {
myFunction();
// Print the variable x in the main function
printf("%d", x);
return 0;
}
prog.c: In function �myFunction�: prog.c:5:7: warning: unused variable �x� [-Wunused-variable] 5 | int x = 5; | ^ prog.c: In function �main�: prog.c:12:16: error: �x� undeclared (first use in this function) 12 | printf("%d", x); | ^ prog.c:12:16: note: each undeclared identifier is reported only once for each function it appears in