I bet none of ya can make a c++ prog less than 10kb :)
Printable View
I bet none of ya can make a c++ prog less than 10kb :)
Can you?
i just compiled
int main(){}
and it was 656098
using g++.
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 KbQuote:
int main()
{
return 0;
}
Ok hotshot, show us if you can do it!!:D
hmm
void main()
{
}
mmmm....Quote:
void main()
{
}
NOPE tried that as well!!
C++ is a high level language so its not possible.
DAMMIT!
hmmmmmmm
no clue dude
Smallest is 24.0KB with VC++
void main(){} or int main(){}
doesn't matter which.
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.
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.