Problem helloworld
User JunWei
Submission Time 2023-08-05 20:33:15
Score 0
Max Time N/A
Max Memory N/A

Compile Error

helloworld.cpp:5:9: error: cannot declare ‘::main’ to be a global variable
5 | int(main)
| ^
helloworld.cpp:7:7: error: invalid user-defined conversion from ‘std::basic_ostream<char>’ to ‘int’ [-fpermissive]
7 | cout << "Hello World"
| ~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/ios:44,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from helloworld.cpp:1:
/usr/include/c++/9/bits/basic_ios.h:117:16: note: candidate is: ‘std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits<char>]’ <near match>
117 | explicit operator bool() const
| ^~~~~~~~
/usr/include/c++/9/bits/basic_ios.h:117:16: note: return type ‘bool’ of explicit conversion function cannot be converted to ‘int’ with a qualification conversion
helloworld.cpp