printf Function | C Programming for Microcontrollers

C Programming – Standard Input/Output (Part 2)

Formatting, Precision, Memory Analysis & Debugging in Eclipse

Welcome to PicoBit-Tech.
I’m Behnam Jafari, and in this session we continue our deep dive into Standard Input and Output functions in C β€” an essential foundation for microcontroller programming and embedded systems development.

This video is Part 2 of our series on mastering formatted input/output in C.


πŸ“Œ Timestamps

00:00 – Introduction
01:15 – Exercise 1: Examining Memory for a String Variable
05:54 – Exercise 2: Using Flags for Formatting
07:58 – Exercise 3: Aligning Strings on a Single Line
10:40 – Exercise 4: Using .precision for Strings and Floats
19:06 – Debugging in Eclipse IDE


πŸ–₯ What You Will Learn

πŸ”Ή Exercise 1 – Memory Examination

Understand how string variables are stored in memory and how to inspect their behavior during execution.

πŸ”Ή Exercise 2 – Formatting with Flags

Learn how to use formatting flags in printf() to control output appearance and structure.

πŸ”Ή Exercise 3 – String Alignment

Align strings properly within formatted output to create structured and readable console displays.

πŸ”Ή Exercise 4 – Using Precision

Explore the .precision specifier for:

  • Controlling string output length

  • Managing floating-point number formatting


🐞 Debugging in Eclipse IDE

We also cover practical debugging techniques inside Eclipse IDE, including:

  • Monitoring variable values

  • Tracking memory changes

  • Using external consoles for improved output visibility

To enable debugging support, you may need the GNU Debugger (GDB):

πŸ”— GDB Package (MSYS2):
https://packages.msys2.org/packages/mingw-w64-x86_64-gdb


🎯 Why This Lesson Is Important

By the end of this tutorial, you will:

βœ” Use printf() professionally with flags, alignment, and precision
βœ” Understand how strings are handled in memory
βœ” Improve debugging skills for C programming
βœ” Strengthen your foundation for embedded and microcontroller development

If you haven’t watched Part 1 yet, we recommend starting there to build a complete understanding of standard I/O concepts in C.

Leave a Reply

Your email address will not be published. Required fields are marked *