fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #define smth
  5.  
  6. int main() {
  7.  
  8. #ifdef smth
  9. puts("smth is defined");
  10. #elseif
  11. puts("smth is not defined");
  12. #endif
  13.  
  14. #ifndef smth // #ifnfed = !ifdef
  15. puts("smth is not defined");
  16. #elseif
  17. puts("smth is defined");
  18. #endif
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:6: error: invalid preprocessing directive #elseif
     #elseif 
      ^
stdout
Standard output is empty