fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int max;
  5.  
  6. int main() {
  7. // your code goes here
  8. cout <<max;
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8:8: error: reference to ‘max’ is ambiguous
 cout <<max;
        ^~~
prog.cpp:4:5: note: candidates are: int max
 int max;
     ^~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:                 template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note:                 template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
stdout
Standard output is empty