Machine-translated by Google. Questions are authored in English.
Top

Discussion

The purpose of the function ctime() is that ___________

  • A.it returns a string representing the local time
  • B.it returns a void string
  • C.it returns a string representing the time in UTC format
  • D.it returns a string representing the time stored in a structure

Answer: A

Correct answer: it returns a string representing the local time

ctime() takes a time_t and returns a printable string in local time, of the form Wed Jun 30 21:49:08 2021\n. It is asctime(localtime(t)) in one call. The string is in a static buffer, so it is overwritten by the next call.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.