The problem:
I hate writing headers or declaring my functions if my computer can do it faster.
And it is the case.
What I tried to do:
I tried to declare a function foo
after the main
function.
But the compiler returns an error:
error: ‘foo’ was not declared in this scope
The code:
#include <iostream>
//no function declaration is allowed, please.
//no other header is allowed, please.
void main() {
foo();
}
void foo() {
std::cout << "The compiler is smart now!" << std::endl;
}
I accept to change the compiler if gcc/g++ is not able to compile this c++ code.
Any response will be greatly thanked.