Search notes:

Preprocessor: Unimportant order of macro definition

The order of definitions of nested macros is unimportant.
#include <stdio.h>

#define NUMBER         FORTY_TWO
#define FORTY_TWO             42

#define FIVE                   5
#define ANOTHER_NUMBER      FIVE


int main() {

  printf("NUMBER         is %2d\n",         NUMBER);
  printf("ANOTHER_NUMBER is %2d\n", ANOTHER_NUMBER);

}
Github repository about-cpp, path: /preprocessor/macros/unimportant-order-of-definition.c
The program prints
NUMBER         is 42
ANOTHER_NUMBER is  5

See also

Preprocessor: macros

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759562060, '216.73.216.149', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/C-C-plus-plus/preprocessor/macros/unimportant-order-of-definition(60): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78