Possible Duplicates:
Changing c++ output without changing the main() function
How to assign a method's output to a textbox value without code behind
How to write hello world without modifying main function? Thanks
int main(){return 0;}
Possible Duplicates:
Changing c++ output without changing the main() function
How to assign a method's output to a textbox value without code behind
How to write hello world without modifying main function? Thanks
int main(){return 0;}
Just add this code to a .cpp file somewhere.
class Hack {
Hack() { cout << "Hello World"; }
} hackInstance;
Use the preprocessor to #define an expansion for return to print hello world, then return.
I'm assuming there's a creative use of #define preprocessor statements that can make this work.
#include<iostream>
int hello() {
cout<<"Hello World"<<endl;
}
static int foo = hello();
int main(){return 0;}