If obj1 and obj2 are both objects of a class that uses dynamic memory allocation, but the class does not have an assignment operator, what happens if you execute the following code?

obj1=obj2;
a. A syntax error occurs, you can not assign one object to another object without the = operator
b. A run-time error occurs, because the C++ system does not know how to do the assignment.
c. The pointer(s) to the dynamically declared memory in obj2 are copied to the corresponding pointers in obj1.
d. There is a complete and independent copy of all the dynamic memory from obj2 to obj1


d. There is a complete and independent copy of all the dynamic memory from obj2 to obj1

Computer Science & Information Technology

You might also like to view...

Which of the following statements is true?

Segment A int q = 5; switch(q) { case 1: System.out.println(1); case 2: System.out.println(2); case 3: System.out.println(3); case 4: System.out.println(4); case 5: System.out.println(5); default: System.out.println("default"); } Segment B q = 4; switch(q) { case 1: System.out.println(1); case 2: System.out.println(2); case 3: System.out.println(3); case 4: System.out.println(4); case 5: System.out.println(5); default: System.out.println("default"); a. The output for Segment A is: default b. The output for Segment B is: 4 c. The output for Segment B is: 45default d. The output for Segment A is: 5 default

Computer Science & Information Technology

What operator is used to access the value of a single variable? by the use of a pointer variable?

A. -> B. & C. * D. You need more than one of these.

Computer Science & Information Technology

You can use the ____________________ attribute to apply the same class to more than one column.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Windows Vista Community is an example of a place on the Web where those with similar interests can meet and is called a(n):

A) online meeting B) online chat C) open forum D) discussion forum

Computer Science & Information Technology