Page 1 of 1

1) A library and a device driver contain code for a set of functions. What is the major difference between a library an

Posted: Sun May 15, 2022 1:17 pm
by answerhappygod
1) A library and a device driver contain code for a set of
functions. What is the major difference between a library and
a device driver?
A) Library functions are intended to be used by applications.
Device drivers are intended to be used by the kernel for a
hardware/system resource.
B) Device drivers are intended to be used by applications.
Library functions are intended to be used by the kernel for a
hardware/system resource.
C) Devices are accessed just like files and can be used
interchangeably with all system libraries.
D) A library is used to store functions for all devices and
device drivers that the computing system might want to access.
2)Using the following line of code, what could be a potential
issue and cause the program to go into an infinite loop?
while ((value = getc(stdin)) != EOF)
a) The value returned from getc is a character and will never
equal to EOF.
b) The getc function is invalid here, getchar should be used
instead.
c) The value returned should be set to a signed character
in order to hold negative values.
d) The value returned should be set to an unsigned character in
order to avoid negative values.
3)What arguments would need to be placed in the argument list
for the fgets function call based on the following code
snippet?
char buf[MAXLINE];
while (fgets(….) != NULL)
A) buf,stdin,stdout,MAXLINE
B) MAXLINE,stdin,buf
C) stdin,MAXLINE,buf,stdout
D) buf,MAXLINE,stdin