intro programming ch 7 up to 7.3

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

7.11 The __________, or address operator, is a unary operator that returns the address of its operand. a) & b) && c) * d) **

a

7.1 Pointers cannot be used to (a) find the address of a variable in memory. (b) reference values directly. (c) simulate call-by-reference. (d) manipulate dynamic data structures.

b

7.12 The statement y = &yPtr; a) assigns the address of the variable y to pointer variable yPtr. b) assigns the address of the variable yPtr to pointer variable y. c) is a compilation error. d) is a logic error.

b

7.4 A non-pointer variable name __________ references a value and a pointer variable name __________ references a value. a) directly, directly b) directly, indirectly c) indirectly, directly d) indirectly, indirectly

b

7.6 Referencing a value through a pointer is called __________. a) interdiction b) indirection c) intermediation d) redirection

b

7.7 Which statement about pointers is false? a) They can be defined to point to objects of any data type. b) The indirection operator * distributes to all comma-separated variable names in a definition. c) The letters Ptr in a pointer variable name are optional. d) A pointer may be initialized to 0, NULL or an address.

b

7.10 Three of the following expressions have the same value. Which of the following's value is different from the others? (a) *&Ptr (b) &*Ptr (c) *Ptr (d) Ptr

c

7.13 Which statement is false? a) The operand of the address operator must be a variable. b) The address operator cannot be applied to constants or to expressions. c) The address operator can be applied to variables defined with the storage class register. d) The address operator can be applied to variables defined with the storage class static.

c

7.14 Which statement is false? a) The unary * operator is called the indirection operator or the dereferencing operator. b) The operand of the unary * operator must be a pointer. c) The unary * operator returns the value of its operand. d) Placing a * operator before a pointer dereferences the pointer

c

7.16 The unary * and __________ are complements of one another. a) / b) ^ c) & d) |

c

7.3 Pointers are variables that contain __________ as their values. a) strings b) flowlines c) memory addresses d) directions

c

7.9 The & operator can be applied to (a) constants (b) variables defined with the storage class register (c) variables defined with the storage class static (d) rvalues

c

7.15 Which statement is generally false? a) Initializing pointers is optional. b) Dereferencing an uninitialized pointer could lead to a fatal execution time error. c) Deferencing an uninitialized pointer could accidentally modify important data. d) Derefencing an uninitialized pointer causes a syntax error.

d

7.2 Pointers may be assigned which of the following? (a) all integer values (b) an address (c) NULL (d) both (b) and (c)

d

7.5 The definition int *count; a) is a syntax error because only pointers can be defined with * notation. b) is a compile-time error. c) is a logic error. d) is a correct definition of integer pointer count.

d

7.8 Which statement about pointers is false? a) A pointer with the value NULL points to nothing. b) NULL is a symbolic constant defined in the header file. c) Initializing a pointer to 0 is equivalent to initializing a pointer to NULL, but NULL is preferred. d) The values 0 and 1 are the only values that can be assigned directly to a pointer variable.

d


Set pelajaran terkait

Ch. 12 Accounting: Project and Evaluating performance

View Set

Prep U- Chapter 9: Chronic Illness and Disability

View Set

CISSP Cryptography (Set 2) cs3600

View Set

chapter 6 multiple choice questions

View Set

Western Civilization Since 1648 (HIST-1600) Ch. 15

View Set

Chapter 6, Section 4: Taft and Wilson

View Set

Lesson 2 - What's your name 你叫什么名字 - PART B

View Set