This is a very basic C++ quiz, it mainly tests a wee bit of knowldege that I've found some people who profess to have a mastery of C++ to be lacking. The answers should all be based on the C++ standard, and not your compiler's implementation.
Use the following code snippet to answer questions 1 through 3:
int* p = new int; int* j = p + 11; int* k = p + 10;
- Is the second line well defined behavior?
- If the second line is well defined, where does the pointer
jpoint to after the second line is executed.
What are some of the legal operations that can be performed on the pointer
What output should the following lines of code produce?
int a = 10; std::cout<<a<<a++<<--a;
Assuming the function called in the following block of code has no default parameters, and that no operators are overloaded, how many parameters does it take? Which objects are passed to it?
f((a, b, c), d, e, ((g, h), i));