What is the smallest C ++ program that will compile without errors?
Functionality is not important.
I believe that it is he
int main(){}
The following should be the shortest:
Note that throwing a return value without invoking undefined behavior is only possible with main() .
main()
This will be a compilation, but not a link .;)
~/blargh 16:48:24 $ cat t.cpp ~/blargh 16:50:21 $ clang++ -c t.cpp ~/blargh 16:50:28 $
int main;
compile with gcc without warning.