Memory allocation at compile time
Hello,
I've been studying memory allocation for variables in C programs, but I'm still not entirely clear on the process. My understanding is that memory for variables isn't allocated until the program runs on a PC. During compilation, the source code is translated into machine code, which includes instructions for memory allocation and program logic. This seems to imply that memory allocation happens at runtime. However, I'm confused about how memory allocation can occur at compile time when the program doesn't actually run on hardware during compilation.
Could you please clarify this concept of memory allocation in C programs?