Question 1
In C++, no name is associated with the pointer data type.
True
False

Question 2
The statement int **table; declares table to be a pointer to a pointer.
True
False

Question 3
Which of the following arithmetic operations is allowed on pointer variables?
a. Modulus
b. Multiplication
c. Increment
d. Division

Question 4
The address of operator is a unary operator that returns the address of its operand.
True
False

Question 5
Pointer arithmetic is the same as ordinary arithmetic.
True
False

Question 6
In C++, you declare a pointer variable by using the ____ symbol.
a. @
b. &
c. *
d. #

Question 7
Variables that are created during program execution are called static variables.
True
False

Question 8
In C++, new is a reserved word; however, delete is not a reserved word.
True
False

Question 9
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

Question 10
In a ____ copy, two or more pointers of the same type point to the same memory.
a. dynamic
b. static
c. deep
d. shallow

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

Question 12
In C++, a function cannot return a value of the pointer type.
True
False

Question 13
The statement delete p; deallocates the dynamic variable pointed to by p.
True
False

Question 14
The member access operator arrow is used to access a class component via a pointer.
True
False

Question 15
The operator new allocates memory at run time and also initializes the allocated memory.
True
False

Question 16
In a(n) ____ copy, two or more pointers have their own data.
a. dynamic
b. deep
c. shallow
d. static

Question 17
The only operation allowed on a pointer variable is the assignment operation.
True
False

Question 18
The code int *p; declares p to be a(n) ____ variable.
a. new
b. num
c. address
d. pointer

Question 19
In C++, pointer variables are declared using the reserved word pointer.
True
False

Question 20
What is the value of x after the following statements execute?

int x = 25;
int *p = &x;
*p = 46;

a. NULL
b. 0
c. 25
d. 46

Recommended Answers

All 4 Replies

We don't do homework for you. You do the homework, we just help. So post what YOU think are the answers.

sorry i thought i did but it didn't show up..please give me a second

These are my answers
1.true
2.false
3.c
4.true
5.false
6.b
7.false
8.false
9.b
10.a
11.false
12.false
13.false
14.false
15.false
16.a
17.false
18.d
19.false
20.d

Here are my guess:

1) Dont get the question, what does "name" mean? DataType?
2) false;
3) C: Increment operators
4) confusing
5) false;
6) c: *
7) false: runtime variable?
8) false;
9) b: 12,81
10) d: shallow
11) true;
12) false, it can;
13) false;
14) true;
15) false;
16) b: deep;
17) false; incremental and subtraction and addition are some counter examples
18) d: pointer-to-int
19) false;
20) d: 46
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.