fork download
  1. #define A 10 // für ein beliebigen Wert val_a
  2. #define B 42 // für ein beliebigen Wert val_b
  3.  
  4. // ...
  5.  
  6. static const int HLPR = A;
  7.  
  8. #undef A
  9. #define A 1
  10.  
  11. #undef B
  12. #define B HLPR
  13.  
  14. int main()
  15. {
  16. printf("%d\n", A); // wird vom preprocessor aufgelöst zu 1 wie gewünscht
  17. printf("%d\n", B); // wird vom preprocessor aufgelöst zu val_a
  18. }
  19.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
1
10