Using a previously defined #define in a new #define in C
问题 Are there any potential issues/dangers in doing something such as #define SAMPLERATE 32 // Sample rate in hertz #define ONE_MINUTE ( SAMPLERATE * 60 ) #define FIVE_MINUTES ( ONE_MINUTE * 5 ) My compiler doesn't issue any errors or warnings. It's very nice because I can change one #define value (SAMPLERATE) and all the others get set to what they need to be with no other changes. I'm just not entirely sure if this is best practice or safe. 回答1: A #define is handled by the pre-processor. The