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

Discussion

Which of the following functions returns a pointer to a string representing the date and time stored in a structure?

  • A.ctime()
  • B.time()
  • C.asctime()
  • D.localtime()

Answer: C

Correct answer: asctime()

asctime() takes a pointer to a struct tm - a broken-down time - and returns a printable string. ctime() does the same starting from a time_t, and localtime() is what produces the struct tm in between.

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

Post your comment

Please log in or register to post a comment.