fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #define DELETE 42
  5.  
  6.  
  7. class DatabaseManager
  8. {
  9.  
  10. public:
  11.  
  12. enum class Action { SAVE , DELETE };
  13.  
  14.  
  15. };
  16.  
  17.  
  18. int main() {
  19.  
  20. /*
  21. DatabaseManager::Action act{DatabaseManager::Acr::AC_DELETE};
  22.  
  23. if (act != DatabaseManager::AC_SAVE ) {
  24. std::cout << "It works!";
  25. }
  26. */
  27. return 0;
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:16: error: expected identifier before numeric constant
 #define DELETE 42
                ^~
prog.cpp:12:33: note: in expansion of macro ‘DELETE’
      enum class Action { SAVE , DELETE };
                                 ^~~~~~
prog.cpp:4:16: error: expected ‘}’ before numeric constant
 #define DELETE 42
                ^~
prog.cpp:12:33: note: in expansion of macro ‘DELETE’
      enum class Action { SAVE , DELETE };
                                 ^~~~~~
prog.cpp:12:24: note: to match this ‘{’
      enum class Action { SAVE , DELETE };
                        ^
prog.cpp:4:16: error: expected unqualified-id before numeric constant
 #define DELETE 42
                ^~
prog.cpp:12:33: note: in expansion of macro ‘DELETE’
      enum class Action { SAVE , DELETE };
                                 ^~~~~~
prog.cpp:15:1: error: expected declaration before ‘}’ token
 };
 ^
stdout
Standard output is empty