Skip to Content
Embedded C Programming
book

Embedded C Programming

by Mark Siegesmund
September 2014
Beginner to intermediate
424 pages
10h 4m
English
Newnes
Content preview from Embedded C Programming
Chapter 13

Function-Like Macros

Abstract

This chapter expands on the #define capability to show how it can be used to implement function-like macros. The reader will learn how macro parameters and arguments work at the preprocessor level.

Both the concatenation operator and stringize operator are covered in detail with examples. The newer macro variadic syntax is also covered, to show how variable parameter lists work with macros.

This chapter contains numerous examples to show how macros can be used to enhance embedded program functionality, maintainability, and readability.

Examples and exercises are for the popular PIC™ microcontroller manufactured by Microchip.

Keywords

Macro

Preprocessor

Stringize

Concatenation

Variadic

Macros ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical C Programming

Practical C Programming

B. M. Harwani

Publisher Resources

ISBN: 9780128013144