- Given the following three lines of code, answer these questions
int* p = new int;
int* j = p + 11;
int* k = p + 10;
- Is the second line valid?
- If the second line is valid, where does the pointer point to?
- What are some of the legal operations that can be performed on the third pointer?
- What output should the following line of code product?
int a = 10; std::cout<
- Assuming the function called in the following block of code has no default parameters, how many parameters does it take? Which objects are passed to it?
f((a, b, c), d, e, ((g, h), i));
- Assuming the function called in the following block of code takes an A* and a B*, what is wrong with the code?
f(new A(), new B());