chtp5_07-TIF-Beta - 7.1Introduction 7.1. Which statement...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
7.1  Introduction 7.1. Which statement about pointers is false? a) They are among C’s most difficult capabilities to master. b) They enable programs to simulate call by reference. c) They are useful to create and manipulate dynamic data structures. d) They cannot be used to create data structures that do not grow and shrink at execution time. ANS: (d) 7.2  Pointer Variable Definitions and Initialization 7.2 Pointers can not 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 ANS: (b) 7.3 Pointers may be assigned to which of the following? (a) all integer values (b) an address (c) NULL (d) both (b) and (c) ANS: (d) 7.4. Pointers are variables that contain __________ as their values a) memory b) flowlines c) memory addresses d) directions ANS: (c) 7.5. 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 ANS: (b) 7.6. The definition int *count; a) is a syntax error because only pointers can be defined with * notation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
b) is a compile-time error. c) is a logic error. d) is a correct definition of integer pointer count . ANS: (d) 7.7. Referencing a value through a pointer is called __________. a) interdiction b) indirection c) intermediation d) redirection ANS: (b) 7.8. 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. ANS: (b) 7.9. 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 <stdio.h> 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. ANS: (d) 7.3  Pointer Operators 7.10 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 ANS: (c) 7.11 All of the following could cause a fatal execution-time error except (a) dereferencing a pointer that has not been assigned to point to a specific address (b) dereferencing a pointer that has not been initialized properly (c) dereferencing a 0 pointer (d) dereferencing a nonpointer ANS: (d)
Background image of page 2
7.12 Three of the following expressions have the same value. Which of the following’s value is different from the others? (a)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

chtp5_07-TIF-Beta - 7.1Introduction 7.1. Which statement...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online