The 2006 Underhanded C Contest Begins
Xcott Craver writes "The second annual Underhanded C Code Contest is live as of April 4th, and runs until July 4th. The object is to write malicious C code that looks perfectly readable and innocent under informal inspection of the source."
hahahaha suckers you lose
I think I should take the time to do this, this year I will write a program for linux and make it run slow on windows.........oh wait it does that anyway.
GeekServ Unix Consulting Services (http://www.geekserv.com)
you got there. Or FreeBSD 4t about 80
10 Print "Losers"
20 GOTO 10
Run
"How do I read from stdin?"
:)
You can't be serious. Try "cin >> var_name" or use getline. Come on, you learn that in CS 100.
"How do I allocate without too much overhead for it?"
Allocate what?
"Wait, I really shouldn't be doing this in the main function. Perhaps I'll make a separate function. Now, hmm.. How do I define a function which takes a reference to an array of char pointers, and what else do I need to know to reallocate the array"
Ahh, allocate an array? Well, in C, arrays are statically sized, but you could create a new, larger one and copy a full one into it. Or you could use the vector data type from the C++ STL. Again, often learned in CS 100.
"Oh right. It also needs to be separated by spaces too, not just newlines"
"I wish there was a nice library function 'char *readfile(stream)' in ANSI C"
Again, try getline. Really, none of this is hard, unless I miss your intentions.
"Shit. Real programming is hard!"
Are you sure you're a real programmer? I'll echo your first sentiment: I think they are meant just for crybabies who can't handle pointers and get confused while tying their shoelaces.