Profile

unixronin: Galen the technomage, from Babylon 5: Crusade (Default)
Unixronin

December 2012

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Expand Cut Tags

No cut tags
Monday, September 19th, 2005 02:53 pm

Pirate code, from [livejournal.com profile] midiamin:

main(int arrrrrrgc, char **arrrrrrgv)

 

Tags:
Monday, September 19th, 2005 11:59 am (UTC)
alternatively, in a 4GL....

select 'Arrrrgghhh!' from dual;
Monday, September 19th, 2005 12:01 pm (UTC)
And then there's parrot code:

awk '{printf("%d%d%d%d\n",1,0,0,0)}'
Monday, September 19th, 2005 02:02 pm (UTC)
yup. what you sed :-)
Monday, September 19th, 2005 02:15 pm (UTC)
yacc like a pirate!
Monday, September 19th, 2005 02:45 pm (UTC)
You *are* over the bounding main, aren't ye?

main( ) {
printf("Arrrgh, you blackheart!");
}
Monday, September 19th, 2005 03:37 pm (UTC)
It do be computer geek humor, matey! I could tell'ee, but then I might have to kill'ee. Arrr!
Monday, September 19th, 2005 03:37 pm (UTC)
(Actually, part of the amusing part is it'd work ... the compiler wouldn't care, as long as you were consistent about it.)
Monday, September 19th, 2005 03:57 pm (UTC)
good luck with the killin me part matey! me powder's dry!
Monday, September 19th, 2005 04:35 pm (UTC)
Well of course it is, me bucko! Did ye think I take ye for a scurvy lubber?




Seriously ... the standard top-level function for a C program is called main(). It is expected to be called with two arguments: an integer telling the length of the second argument, followed by an argument vector of pointers to strings. By convention, these are called argc and argv; thus main() is typically declared as follows:

int main (int argc, char **argv)

However, as long as you're consistent about it, you could call those two variables whatever you like. You could call them ren and stimpy, so long as you always consistently referenced them by those names throughout main().

int main (int ren, char **stimpy)

So if you're feeling piratical and feel like inserting a few extra Rs, ti works just fine ... as long as you're consistent about it. :)
Monday, September 19th, 2005 09:12 pm (UTC)
kewl, i never got passed DOS 3.5 and GWBASIC when i was fiddlin with stuffs. i still hate windoze though!