WorksheetsUnit 12 : error no
Total questions: 6
Worksheet time: 3mins
Name
Class
Date
1.
Which library function is used to display an error message corresponding to the error stored in errno?
a)
perror()
b)
printf()
c)
strerror()
d)
fprintf()
2.
What does the function fopen() return if it fails to open a file?
a)
EOF
b)
0
c)
-1
d)
NULL
3.
Which header file contains the definition of the errno variable?
a)
stdio.h
b)
assert.h
c)
errno.h
d)
time.h
4.
What does EOF stand for in file handling?
a)
End of File
b)
Error on File
c)
all
d)
End of Frame
5.
How many arguments does the main function take when using command-line arguments?
a)
1
b)
-1
c)
2
d)
4
6.
What does argc represent in the main(int argc, char *argv[]) function?
a)
Argument count
b)
Array of arguments
c)
Pointer to arguments
d)
Argument vector
100 %
