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.
Add your answer
Loading...

Leave a comment

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