Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 18 pages
Exam (elaborations)

CSCI 2010 MIDTERM CH 9, 11, 13 REVIEW QUESTIONS

Document preview thumbnail
Preview 3 out of 18 pages

CSCI 2010 MIDTERM CH 9, 11, 13 REVIEW QUESTIONS

Content preview

CSCI 2010 MIDTERM CH 9, 11, 13 REVIEW
QUESTIONS


The _________ , also known as the address operator, returns the memory address of a
variable.
a. asterisk ( * )
b. ampersand ( & )
c. percent sign (%)
d. exclamation point ( ! )
e. None of these - Answers - B

With pointer variables, you can __________ manipulate data stored in other variables.
a. never
b. seldom
c. indirectly
d. All of these
e. None of these - Answers - C

The statement int *ptr;
has the same meaning as
a. int ptr;
b. *int ptr;
c. int ptr*;
d. int* ptr;
e. None of these - Answers - D

When you work with a dereferenced pointer, you are actually working with:
a. a variable whose memory has been deallocated
b. a copy of the value pointed to by the pointer variable
c. the actual value of the variable whose address is stored in the pointer variable
d. All of these
e. None of these - Answers - C

These can be used as pointers.
a. Array names
b. Numeric constants
c. Punctuation marks
d. All of these
e. None of these - Answers - A

The contents of pointer variables may be changed with mathematical statements that
perform:
a. all mathematical operations that are legal in C++

,b. multiplication and division
c. addition and subtraction
d. b and c
e. None of these - Answers - C

A pointer may be initialized with
a. the address of an existing object
b. the value of an integer variable
c. the value of a floating point variable
d. all of these
e. None of these - Answers - A

What does the following statement do?
double *num2;
a. Declares a double variable named num2.
b. Declares and initializes an pointer variable named num2.
c. Initializes a variable named *num2.
d. Declares a pointer variable named num2.
e. None of these - Answers - D

When the less than ( < ) operator is used between two pointer variables, the expression
is testing whether
a. the value pointed to by the first is less than the value pointed to by the second
b. the value pointed to by the first is greater than the value pointed to by the second
c. the address of the first variable comes before the address of the second variable in
the computer's memory
d. the first variable was declared before the second variable
e. None of these - Answers - C

Look at the following statement
This statement...
sum += *array++;
a. is illegal in C++
b. will always result in a compiler error
c. assigns the dereferenced pointer's value, then increments the pointer's address
d. increments the dereferenced pointer's value by one, then assigns that value
e. None of these - Answers - C

Use the delete operator only on pointers that were
a. never used
b. not correctly initialized
c. created with the new operator
d. dereferenced inappropriately
e. None of these - Answers - C

A function may return a pointer, but the programmer must ensure that the pointer

, a. still points to a valid object after the function ends
b. has not been assigned an address
c. was received as a parameter by the function
d. has not previously been returned by another function
e. None of these - Answers - A

Which of the following statements is not valid C++ code?
a. int ptr = &num1;
b. int ptr = int *num1;
c. float num1 = &ptr2;
d. All of these are valid
e. All of these are invalid - Answers - E

Which of the following statements deletes memory that has been dynamically allocated
for an array?
a. int array = delete memory;
b. int delete[ ];
c. delete [] array;
d. new array = delete;
e. None of these - Answers - C

When this is placed in front of a variable name, it returns the address of that variable.
a. asterisk ( * )
b. conditional operator
c. ampersand ( & )
d. semicolon ( ; )
e. None of these - Answers - C

What will the following statement output?
cout << &num1;
a. The value stored in the variable called num1.
b. The memory address of the variable called num1.
c. The number 1.
d. The string "&num1".
e. None of these - Answers - B

A pointer variable is designed to store
a. any legal C++ value
b. only floating-point values.
c. a memory address.
d. an integer.
e. None of these - Answers - C

Look at the following statement.int *ptr;
In this statement, what does the word int mean?
a. the variable named *ptr will store an integer value

Document information

Uploaded on
June 10, 2026
Number of pages
18
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$14.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GEEKA
3.8
(361)
Sold
2138
Followers
1448
Items
58688
Last sold
1 day ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions