A Short and Relatively Simple Quiz
- Given the following three lines of code, answer these questions
int* p = new int[10];
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());
0
Sign in to follow this
Followers
0
23 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now