Exam 10: Pointers and Dynamic Arrays

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Given the declarations below,write a code fragment that allocates a nameless variable for pointer p1 to point to. int *p1,*p2;

(Short Answer)
4.8/5
(34)

Tell about the freestore (also known as heap).What is put there? How is this done? How does a program access the freestore? What happens to memory that has been allocated but is no longer needed?

(Essay)
4.8/5
(38)

One can use the & operator to extract the value that a pointer points to.

(True/False)
4.8/5
(43)

A copy constructor has the same name as the class (let's call it A)and has a parameter that

(Multiple Choice)
4.9/5
(43)

Here is the first line of the copy constructor for PFArrayD.The identifier PFArrayD is the name of the class,but in the header it is used three times with different meaning each time.Give the meaning for each use: PFArrayD::PFArrayD( const PFArrayD& pfaObject)

(Essay)
4.9/5
(30)

A function can return an array.

(True/False)
4.7/5
(33)

Write a type definition for a type called NumberPtr that will be the type for pointer variables that hold pointers to dynamic variables of type double.Also,write a declaration for a pointer variable called myPoint,which is of type NumberPtr.

(Short Answer)
4.8/5
(39)

Dangling pointers present no problem in C++

(True/False)
4.8/5
(43)

Describe the action of the new operator.What does the new operator return? What are the indications of error?

(Essay)
5.0/5
(42)
Showing 21 - 29 of 29
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)