CS 3377 Dollinger UNIX Exam 2 Questions With
Complete Answers
when a program starts, what are the three standard file descriptors that are open and ready
for use? (only need to know that there are three) - ANSWER 1. stdin
2. stdout
3. stderr
gives you a freopen, know what it does - ANSWER - reopens a file with a different mode
- freopen works on streams
what are the four areas in the c++ programming memory model? - ANSWER 1. stack
2. heap
3. bss
4. uninitialized data area
which one of the four segments of the program lasts the lifetime of the program unless your
application deletes it? - ANSWER heap
in the c++ program memory model, what contains variables that are explicitly initialized in
the program? - ANSWER initialized data segment
, in the c++ programming memory model, data in this memory area is initialized by the kernel
to arithmetic 0 until the programs stops executing - ANSWER uninitialized data segment
in the c++ programming memory model, what memory area stores information that is saved
each time a function is called? and each time a function is called, the address the word will
return to any arguments. - ANSWER stack
in the c++ memory model, what's the memory area that does dynamic memory allocation? -
ANSWER heap
what part of the memory consists of the machine instructions that the cpu executes? -
ANSWER text segment
what's stored in the BSS (know what the bss is -> text segment?) - ANSWER static variables
where's dynamic memory done? - ANSWER heap
in the c++ programming memory model, the uninitialized memory area variables have a
lifetime of the program. (t/f) - ANSWER true
after a fork, identify the differences b/t a parent and a child - ANSWER both parent and child
have different processes and different return values(?) check this
Complete Answers
when a program starts, what are the three standard file descriptors that are open and ready
for use? (only need to know that there are three) - ANSWER 1. stdin
2. stdout
3. stderr
gives you a freopen, know what it does - ANSWER - reopens a file with a different mode
- freopen works on streams
what are the four areas in the c++ programming memory model? - ANSWER 1. stack
2. heap
3. bss
4. uninitialized data area
which one of the four segments of the program lasts the lifetime of the program unless your
application deletes it? - ANSWER heap
in the c++ program memory model, what contains variables that are explicitly initialized in
the program? - ANSWER initialized data segment
, in the c++ programming memory model, data in this memory area is initialized by the kernel
to arithmetic 0 until the programs stops executing - ANSWER uninitialized data segment
in the c++ programming memory model, what memory area stores information that is saved
each time a function is called? and each time a function is called, the address the word will
return to any arguments. - ANSWER stack
in the c++ memory model, what's the memory area that does dynamic memory allocation? -
ANSWER heap
what part of the memory consists of the machine instructions that the cpu executes? -
ANSWER text segment
what's stored in the BSS (know what the bss is -> text segment?) - ANSWER static variables
where's dynamic memory done? - ANSWER heap
in the c++ programming memory model, the uninitialized memory area variables have a
lifetime of the program. (t/f) - ANSWER true
after a fork, identify the differences b/t a parent and a child - ANSWER both parent and child
have different processes and different return values(?) check this