How-to: printf and scanf Basics

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
18,895
Loading...
Alert icon
Sign in or sign up now!
Alert icon
There is no Interactive Transcript.

Uploaded by on Aug 21, 2009

When programming in C, whether for a normal PC or for a microcontroller, it's common to want to read and display data in human-readable formats. The printf and scanf family of functions provide an easy way to do so while taking advantage of code already built into the standard C library.

In this tutorial, we go over the basics of printf and scanf and their program-memory cousins printf_P and scanf_P, as well as fprintf_P. We show how to use format strings, escape sequences, and various flags indicating numeric precision and more.

The tutorial ends with an interactive example demonstrating both printf and scanf.

For source code and more details, please see:
http://www.nerdkits.com/videos/printf_and_scanf/

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (7)

Sign In or Sign Up now to post a comment!
  • datz important discussion.. and clearly..

  • Thanks. Learnt that we can use "%lf " to input negative numbers using scanf.

    " %f " doesn't work with scanf.

  • This was very helpful

  • great video 2 understand....

  • Great tutorial. Looks like an interesting kit to get into micro-controllers programming.

  • cool... thanks for the tips. u rock

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more