Expert C Programming Day1
Expert C Programming Day1
#include <stdio.h>
int main() {
int x = 5;
printf("%d\n", x);
return 0;
GCC (or any C compiler) turns your code into machine language in steps:
The OS gives your program memory to run. Here's a simple memory layout:
Inside the main() function, x is stored in the stack - temporary memory used during function
execution.
BSS (Optional)
int a; // BSS