Join Dan Gookin for an in-depth discussion in this video Working with time functions, part of Learning C (2014).
- I've yet to encounter a programmable device that…didn't have some sort of internal clock.…Computer has a clock and thanks to the Internet…modern computers keep accurate track of the time.…When your code needs to access that information…you dip into the C language library's…assortment of time functions.…In this movie you'll see how time…functions work in the C language.…You'll learn how to check the time, read time values,…and how to gather information about the current date.…
This code uses the direct value…generated by the time function, as shown by the…second argument in the printf function at line six.…You'll see that the placeholder is ld,…which is a long integer value or a very large integer.…That's the type of value returned from the time function.…The time function itself requires an argument.…Here I'm using the NULL pointer…constant to keep the function happy.…
Also keeping the compiler happy is the inclusion…of the time header file at line two.…Build and run this code.…So this value is the current time.…
- Understanding a C program
- Adding comments
- Using escape characters
- Working with values and placeholders
- Introducing variables
- Making a decision with if
- Adding functions
- Manipulating strings
- Building arrays
- Nesting structures
Skill Level Beginner
1. Getting Started
2. Programming Basics
3. Program Flow Control
4. Intermediate C Language Concepts
5. Advanced C Language Concepts
Next steps2m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.