I have started to look at c programming and whilst I am not a complete beginner (I have knowledge of java and web development) there are a lot of things I do not understand.
My question is about when a program is first loaded into memory. I am having trouble understanding what actually happens here.
Is all of the program code loaded into memory when the program is launched or is only what is needed loaded in?
After this does this code\set of instructions get swapped in and out of the physical disk as the process gets CPU time or does loaded code stay in memory whilst the program is running?
If two processes can share the same set of instructions does this mean each process gets a separate code section in its virtual memory space?
I am sorry if my questions are basic or poorly worded but I only started looking at this last week and after a weekend of reading I have far more questions than answers!