Search⌘ K

Storing Data Using Strings, Constants, and Macros

Explore how to efficiently store data values like colors and statuses in C using strings, constants, and macros. Learn the memory and usability trade-offs involved with each technique, and understand when to apply these methods for clearer, more organized code.

All user-defined data types are built out of primary data types. Of these, this chapter discusses the data type called Enum (short for Enumeration).

Ways of storing colors

During programming, we are often required to store and use values of colors, marital status, etc. ...