You're developing an embedded system with limited memory and need to define several constants representing the states of a system. Which C construct would be most appropriate to use?
- Using functions
- Using global variables
- Using local variables
- Using macros
In an embedded system with limited memory, using macros would be most appropriate for defining constants as they are preprocessor directives and are more memory-efficient than global or local variables. Functions are not used for constants.
Loading...
Related Quiz
- The preprocessor directive ________ is used to include libraries in a C program.
- You are tasked with creating a system to manage a library's book inventory. How can structures be utilized in this scenario?
- The function ________ is used to find the first occurrence of a character in a string in C.
- How are the members of a structure accessed in C?
- Consider a scenario where a program needs to store a character read from a file. Which data type would be appropriate for this?