Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Which one of the following function is capable of reading a specific number of characters from a file?

a) fgets()
b) fget()
c) fileget()
d) filegets()

Answer: a
Explanation: The function fgets() will return a line from an open file. This stops returning on a new line, at the specified length, or at EOF, whichever comes first. Its prototype is string fgets(resource handle [, int length]). If the optional length parameter is omitted, 1024 character is assumed.

Join The Discussion