I bet none of ya can make a c++ prog less than 10kb
I bet none of ya can make a c++ prog less than 10kb
i just compiled
int main(){}
and it was 656098
using g++.
Best Regards,
Bonkey
i don't have access to my compiler right now but i think
int main()
{
return 0;
}
might do it
Nope. Tried that and alot of other things. All gave me the same size : 56.0 KB / 51.0 Kbint main()
{
return 0;
}
Ok hotshot, show us if you can do it!!
mmmm....void main()
{
}
NOPE tried that as well!!
DAMMIT!
hmmmmmmm
no clue dude
Smallest is 24.0KB with VC++
void main(){} or int main(){}
doesn't matter which.
My Avatar says: "Stay in School"
Rocco is the Boy!
"SHUT YOUR LIPS..."
gave me 13k here...Code:int main () { return 0; }
I made a program in C++ that was 955 bytes long.
All it does is cause a segmentation fault, but it compiles and executes!
>Smallest is 24.0KB with VC++
This'd do it on MSVC++ -
With the linker options -Code:#define main mainCRTStartup int main() { return 0; }
/NODEFAULTLIB /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:IX86
Comes in at exactly 1 KB. You may be able to get it lower than that by tinkering with the options a little more. It's not really a valid C++ program but I'd guess most compilers have the option of turning off the default runtime.
Removing the /NODEFAULTLIB in MSVC and compiling with the standard main produces a 3.5KB exe.
Joe
But does it execute?
>But does it execute?
Yes, but you'd have problems unless you want to code some of the start up runtime yourself.
Joe