3 ms·
How about: main(){*(int*)0=0;} or: main(){*""=0;} or: main(){main();}
by marshray 13y ago
How about:
main(){*(int*)0=0;}
or:
main(){*""=0;}
or:
main(){main();}
- pdw 13y agoThe last one is just as likely an infinite loop as a crash. Even C compilers occasionally manage to do tail-call optimization these days.
- mikeash 13y agoAll substantially longer than the example given.
- marshray 13y agoThe site was down when I made my suggestions. Still, I think mine may be a bit more language compliant than the shortest variants in the article.
- rwmj 13y agoEdit: deleted because I got to the Google cache and that's what the site was suggesting.
- marshray 13y agoThat's essentially where he's going with it, noting that you can even leave off the "=0". But as others here point out there's some question as to how many linkers will actually produce an executable image from that source.
- marshray 13y agoThat's essentially where he's going with it, noting that you can even leave off the "=0". But as others here point out there's some question as to how many linkers will actually produce an executable image from that source.