Start time:
Mi 31 Jan 2018 09:50:53
End time:
So 06 Mai 2018 09:45:53

Assignments: 10

Task 0101: Raw pointers (Slides 40-63)
What is the result of the following code? Would the program crash or cause undefined behavior?
Task 0102: Raw pointers (Slides 40-63)
Implement a function swap_values that enables the user to swap two given integer values.
Task 0103: Raw pointers (Slides 40-63)
Modify your code such that you can swap integer pointers instead
Task 0104: Raw pointers (Slides 40-63)
Draw a diagram for the main function in (0103) illustrating the heap/stack memory layout after swap_values has been called.
Task 0201: Arrays (Slides 64-93)
Given the C++ program below. Write down the state of the stack and the heap after each change to either one of them. Explain the consequences and potential problems of the statement a = nullptr;
Task 0202: Arrays (Slides 64-93)
Implement a recursive function with the following signature to perform a binary search on a given integer array: bool binary_search(const int* begin, const int* end, int key)...
Task 0203: Arrays (Slides 64-93)
Create a program that takes an arbitrary number of strings as command line arguments, reads them into a std::vector<std::string> and finally outputs them via cout using a range-based for...
Task 0301: Memory (Slides 40-112)
Re-implement the program from exercise (0101) using references instead of pointers.
Task 0302: Memory (Slides 40-112)
What is the output by the following code?
Task 0303: Memory (Slides 40-112)
For the given C++ code, answer the following questions: What is the type of each variable a-o ? Which assignments in the code are erroneous? Why?