#include <iostream>
using namespace std;
int max;
void cal(int i){ cout<< max;}
int main() {
// your code goes here
cal(1);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1heDsKdm9pZCBjYWwoaW50IGkpeyBjb3V0PDwgbWF4O30KCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQpjYWwoMSk7CglyZXR1cm4gMDsKfQ==
prog.cpp: In function ‘void cal(int)’:
prog.cpp:5:25: error: reference to ‘max’ is ambiguous
void cal(int i){ 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)
^~~