The printf() function's formatting string can contain conversion specifications. Each specification, or placeholder, represents an argument after the formatting string in the printf() function. The conversion specification formats the argument's output based on type, width, and other specifications.
- [Instructor] The first argument in the printf function … is a formatting string. … It contains standard characters to output … but also conversion specifications, … which are commonly called placeholders. … These placeholders represent additional arguments … in the function, which are converted to text … and inserted into the format string for output. … Conversion specifications are prefixed … by the percent character. … This character is followed by optional characters … to set output width, justification, … and other formatting details. … The conversion character comes last. … It's related to its companion argument's data type. … For each conversion character, … an argument must be available in the printf function. … If not, the compiler issues a warning. … A warning may also be issued when the placeholder … doesn't match the argument's data type. … Here's a list of common conversion characters, … though your compiler may feature more. … For example, percent d generates decimal output …
- Working with arrays
- Building a structure
- Creating an array of structures
- Testing characters
- Working with strings in C
- Using pointers to manipulate data
- Manipulating files
- Using command-line arguments
- Working with time functions
Skill Level Intermediate
1. Arrays and Structures
2. Characters and Strings
4. Files and the Operating System
5. The Interesting and Extraordinary
Next steps1m 52s
- 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.