Home > Programming > Tidier Tables in “C” via Macros

Tidier Tables in “C” via Macros

Great article titled Reduce C-language coding errors with X macros outlines a way to use the C Preprocessor to create tidier tables.  Highly recommended reading for those of you who like data-driven solutions.

How many times have you used a “table” in C code?  Data-driven approaches are great, but often require you to manually keep table data in sync in multiple places in your code.  It’s a common maintenance issue in “C”.  This article describes ways to make the Preprocessor to do more of the work for you.  The result is fewer bugs and reduced workload when you update your tables.  The cost may be slightly lower readability for less experienced programmers.

Whether you chose to use this technique or not, you owe it to yourself to at least check it out.

Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: