fork(1) download
  1. #include <cstdint>
  2.  
  3. static uint16_t MAGIC_NUMBER_VAL = 7076;
  4.  
  5. #define convert_func(NUM) 0x ## NUM
  6.  
  7. static const uint16_t val = convert_func(MAGIC_NUMBER_VAL); //0x7076
  8. static const uint16_t val_tag = MAGIC_NUMBER_VAL;
  9.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:5:27: error: unable to find numeric literal operator ‘operator""xMAGIC_NUMBER_VAL’
 #define convert_func(NUM) 0x ## NUM
                           ^~
prog.cpp:7:29: note: in expansion of macro ‘convert_func’
 static const uint16_t val = convert_func(MAGIC_NUMBER_VAL); //0x7076
                             ^~~~~~~~~~~~
stdout
Standard output is empty