C How To Program 7th Edition Deitel Test Bank
C How To Program 7th Edition Deitel Test Bank
C How To Program 7th Edition Deitel Test Bank
11.1 Introduction
11.1 ________ are used for permanent retention of large amounts of data.
(a) Structures
(b) Arrays
(c) Records
(d) Files
ANS: (d)
11.4 Which of the following is not part of the FILE structure specified in <stdio.h>?
(a) file descriptor
(b) open file table
(c) read/write methods
(d) file control block
ANS: (c)
11.6 Which of the following is not automatically opened when a C program begins?
a) standard error
b) standard output
c) standard dialog
d) standard input
ANS: (c)
11.8 The standard __________ stream enables a program to read data from the keyboard.
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
C How to Program, 7/e Multiple Choice Test Bank
a) read
b) keyboard
c) dialog
d) input
ANS: (d)
11.11 Which mode would you use if you wanted to open a file for both reading and writing?
(a) r+
(b) w+
(c) a+
(d) all of these
ANS: (d)
11.12 If an error occurs while opening a file in any mode, function fopen returns ________.
(a) true
(b) NULL
(c) false
(d) -1
ANS: (b)
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
C How to Program, 7/e Multiple Choice Test Bank
ANS: (a)
11.22 If an error occurs while opening a file in any mode, fopen __________.
a) causes program termination
b) returns NULL
c) issues the message “can’t open file”
d) diagnoses the error, waits five minutes and retries
Ans: (b)
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
C How to Program, 7/e Multiple Choice Test Bank
11.25 Which of the following is a function that causes a program’s file position pointer to be repositioned
to the beginning of the file?
(a) rescan
(b) rewind
(c) return
(d) none of these
ANS: (b)
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
C How to Program, 7/e Multiple Choice Test Bank
11.36 sizeof
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
C How to Program, 7/e Multiple Choice Test Bank
a) is a compile-time function
b) is a compile-time unary operator
c) is a run-time unary operator
d) is a run-time function
ANS: (b)
11.37 Which of the following is an argument of the fseek function that can have the values SEEK_SET,
SEEK_CUR or SEEK_END?
(a) stream
(b) offset
(c) whence
(d) none of these
ANS: (c)
11.39 The symbolic constant __________ indicates that the file position pointer is to be positioned
relative to the beginning of the file by the amount of the offset.
a) SEEK_SET
b) SEEK_BEGIN
c) SEEK_START
d) SEEK_CUR
ANS: (a)
11.40 Which of the following is a function that reads a specified number of bytes from a file into
memory?
(a) fseek
(b) fwrite
(c) fread
(d) fopen
ANS: (c)
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.
C How to Program, 7/e Multiple Choice Test Bank
a) Because the account numbers start at 0 and the file starts at position 0.
b) Because the account numbers start at 0 and the file starts at position 1.
c) Because the account numbers start at 1 and the file starts at position 0.
d) Because the account numbers start at 1 and the file starts at position 1.
ANS: (c)
© Copyright 1992-2013 by Deitel & Associates, Inc. and Prentice Hall. All Rights Reserved.