What limitation did early computers have regarding program execution?
Early computers allowed only one program to be executed at a time.
In early computer systems, the single running program had complete control of the system and access to all its _____.
resources
How do modern computer systems handle multiple programs compared to early systems?
Modern systems allow multiple programs to be loaded into memory and executed concurrently.
What is the formal definition of a process?
A process is a program in execution.
What was the historical term for a process in the early days of computing?
A process was called a job.
What is the purpose of the ‘Text Section’ in a process’s memory layout?
The Text Section contains the executable code.
What does the ‘Data Section’ of a process contain?
The Data Section contains global variables.
The ‘Heap Section’ of a process contains memory that is _____ allocated during run time.
dynamically
What is the function of the ‘Stack Section’ in a process?
It provides temporary data storage when functions are invoked.
What are some examples of data stored in the stack section of a process?
It contains function parameters, return addresses, and local variables.
Why are the sizes of the text and data sections considered fixed?
Their sizes do not change during program run time.
Which two sections of a process can shrink and grow dynamically during execution?
The stack and heap sections.
What is pushed onto the stack each time a function is called?
An activation record containing function parameters, local variables, and the return address.
When is the activation record popped from the stack?
The activation record is popped from the stack when control is returned from the function.
Under what circumstance does the heap section grow?
The heap grows as memory is dynamically allocated.
When does the heap section shrink?
The heap shrinks when memory is returned to the system.
What must the operating system ensure regarding the stack and heap sections as they grow toward each other?
The operating system must ensure they do not overlap.
In the memory layout of a C program, the data section is divided into which two sub-sections?
It is divided into initialized and uninitialized data sub-sections.
In a C program’s memory layout, what are the argc and argv parameters provided with?
A separate section is provided for the argc and argv parameters passed to the main() function.
What are the values passed from the command line to a C program called?
They are called command line arguments.
Command line arguments are important when you want to control your program from the outside instead of _____ those values inside the code.
hard coding
In C, how are command line arguments handled within the code?
They are handled using the main() function arguments, argc and argv.
How is the integer value of argc determined?
argc is equal to the sum of the number of command-line arguments and one.
What is the data type and structure of the argv[] parameter in C’s main function?
argv[] is an array of strings (character pointers).