1. Engineering
  2. Computer Science
  3. question 1 a function may return a pointer but the...

Question: question 1 a function may return a pointer but the...

Question details

QUESTION 1 A function may return a pointer, but the programmer must ensure that the pointer: O still points to a valid object after the function ends O has not been assigned an address O was received as a parameter by the function O has not previously been returned by another function O None of these QUESTION2 A pointer may be initialized with: o the address of an existing object O the value of an integer variable the value of a floating point variable O All of these None of these QUESTION 3 A pointer variable is designed to store: O any legal C+ value O only floating-point values o a memory address o an integer O None of these

QUESTION 4 A pointer variable may be initialized with: o any non-zero integer value o any address in the computers memory O an address less than 0 O any non-zero integer value and an address less than 0 only O None of these QUESTION5 Assuming ptr is a pointer variable, what will the following statement output? coutptr O the value stored in the variable whose address is contained in ptr the string ptr O the address of the variable stored in ptr O the address of the variable whose address is stored in ptr O None of these QUESTION 6 Dynamic memory allocation occurs: O when a new variable is created by the compiler o when a new variable is created at runtime o when a pointer fails to dereference the right variable o when a pointer is assigned an incorrect address O None of these

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution