Filters
Question type

Study Flashcards

Which of the following operations is allowed on pointer variables?


A) exp
B) %
C) ==
D) /

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

In a(n) ____ copy,two or more pointers have their own data.


A) shallow
B) deep
C) static
D) dynamic

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

B

What is the output of the following code? int *p; Int x; x = 12; p = &x; cout << x << ","; *p = 81; Cout << *p << endl;


A) 12, 12
B) 12, 81
C) 81, 12
D) 81, 81

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

The code int *p; declares p to be a(n) ____ variable.


A) new
B) num
C) pointer
D) address

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

The dereferencing operator is also known as the indirection operator and refers to the object to which its operand points.

A) True
B) False

Correct Answer

verifed

verified

Consider the following statements: void pointerParameters(int* &p,double *q) { . . . } In the function pointerParameters,the parameter p is a(n)____________________ parameter.

Correct Answer

verifed

verified

A memory leak is an unused memory space that cannot be allocated.

A) True
B) False

Correct Answer

verifed

verified

A pointer variable is a variable whose content is a memory address.

A) True
B) False

Correct Answer

verifed

verified

Once a class contains one or more pure virtual functions,then that class is called a(n)____________________ class.

Correct Answer

verifed

verified

Consider the following statements: void pointerParameters(int* &p,double *q) { . . . } In the function pointerParameters,the parameter q is a(n)____________________ parameter.

Correct Answer

verifed

verified

If p is a pointer variable,the statement p = p + 1; is valid in C++.

A) True
B) False

Correct Answer

verifed

verified

Given the declaration int *p; The statement p = new int[50]; dynamically allocates an array of 50 components of type int and p contains the base address of the array.

A) True
B) False

Correct Answer

verifed

verified

True

Consider the following statements: int x; int &y = x; The second statement declares y to be a(n)____________________ of x.

Correct Answer

verifed

verified

In the statement int* p,q; p and q are pointer variables.

A) True
B) False

Correct Answer

verifed

verified

False

In C++,you declare a pointer variable by using the ____ symbol.


A) *
B) &
C) #
D) @

E) None of the above
F) A) and D)

Correct Answer

verifed

verified

In C++,the dot operator has a lower precedence than the dereferencing operator.

A) True
B) False

Correct Answer

verifed

verified

The ____________________ of a base class automatically makes the destructor of a derived class virtual.

Correct Answer

verifed

verified

Which of the following can be used to initialize a pointer variable?


A) 1
B) NULL
C) "0"
D) '0'

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

In C++,____ is called the address of operator.


A) &
B) *
C) #
D) ->

E) A) and D)
F) A) and B)

Correct Answer

verifed

verified

The ____ operator can be used to return the address of a private data member of a class.


A) dereferencing
B) destructor
C) address of
D) member access

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer