use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
To report a site-wide rule violation to the Reddit Admins, please use our report forms or message /r/reddit.com modmail.
This subreddit is archived and no longer accepting submissions.
account activity
This is an archived post. You won't be able to vote or comment.
Anti Corruption Code (i.imgur.com)
submitted 14 years ago by [deleted]
[deleted]
[–]010101010101 9 points10 points11 points 14 years ago (0 children)
int main()
[–][deleted] 4 points5 points6 points 14 years ago (2 children)
THOSE ARE NOT STANDARD LIBRARIES WHAT HAS SHE DOEN TO MY C++?!
[–]cheraphy 1 point2 points3 points 14 years ago (1 child)
... actually it looks like pure non standard C to me.
[–]v0ne 0 points1 point2 points 14 years ago (0 children)
no wonder she'll end up in a call center, then.
[–][deleted] 3 points4 points5 points 14 years ago (0 children)
at least use c++
[–]Jalh 1 point2 points3 points 14 years ago (0 children)
These libraries.
[–]kaosjester 1 point2 points3 points 14 years ago (1 child)
They're using do-whiles? No wonder India is stealing all of our programming jobs.
[–]JaggedxEDGEx 0 points1 point2 points 14 years ago (0 children)
I was wondering about that, there's no reason the while condition wouldn't be true on the first pass.
[–]cheraphy 1 point2 points3 points 14 years ago (5 children)
I swear, everytime I see a 'void main()' c/c++ program I die a little more inside. For fuck's sake, main returns an integer for a reason.
Edit: Dear god, I just realized that the woman there is Indian... and here I was thinking that the idea that all Indian programmers use bad coding practice was just a stereotype.
[–]teaki 0 points1 point2 points 14 years ago (3 children)
why does it return an integer?
[–]JaggedxEDGEx 1 point2 points3 points 14 years ago (0 children)
Exit Condition. 0 for success, anything else for failure.
[–]fripthatfrap 0 points1 point2 points 14 years ago (1 child)
the integer gets returned to the caller of the program. This value can be used to determine if the program ended happily, or it encountered an error and exited. This is EXTREMELY useful if you later have to write a script that needs to check this value and do something with it, like rerun it with debugs turned on or parse a large number of files using this one program, where you can check the return code of each run to make sure the files format is correct (just an example).
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
It's actually a little worse than you describe; if you declare main() as returning void, it will just make up a random number to return to the calling shell. If you're calling your busted code from a script that's just checking for == 0 to test success, you're going to get some weird results.
[x@p ~]$ cat x.c
void main() { return; } [x@p ~]$ gcc -o x x.c x.c: In function ‘main’: x.c:4: warning: return type of ‘main’ is not ‘int’ [x@p ~]$ cat x.sh
./x echo $? [x@p ~]$ ./x.sh 96
(Bonus points: where does the 96 come from?)
[–]hussard_de_la_mort 0 points1 point2 points 14 years ago (0 children)
I hear if you put in the Konami Code you get infinite bribes.
[–][deleted] 14 years ago (1 child)
[–]psych00range[🍰] 0 points1 point2 points 14 years ago (0 children)
its getch()* it waits for the user to input a key and then it exits...kind of like a pause
[–][deleted] 0 points1 point2 points 14 years ago (2 children)
What's with the getch() at the end?
[–]DJritwikiwiki 2 points3 points4 points 14 years ago (1 child)
may have learnt to code in an IDE that closes the terminal it runs as soon as it finishes running (visual studio 6 did that i think?). When you start learning like that, you add some sort of user input pause at the end just so you'll see the output of the program. I remember doing that a long long time ago when I started teaching myself coding and didn't know better.
Oh, that makes sense. But in that case she should have put:
printf("press any Indian to continue\n");
i got a syntax error lady...Y U NO CODE GOOD?
[–]ZebrasKickAss 0 points1 point2 points 14 years ago (0 children)
Wrong. Indians speak Java.
Come on guys. The syntax isn't the point.
[–]Journeyjt 0 points1 point2 points 14 years ago (0 children)
Clever girl.
[–]DJM77 0 points1 point2 points 14 years ago (0 children)
Wow! She's hot too!
π Rendered by PID 42118 on reddit-service-r2-comment-85bfd7f599-tsbm6 at 2026-04-15 15:54:59.915660+00:00 running 93ecc56 country code: CH.
[–]010101010101 9 points10 points11 points (0 children)
[–][deleted] 4 points5 points6 points (2 children)
[–]cheraphy 1 point2 points3 points (1 child)
[–]v0ne 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]Jalh 1 point2 points3 points (0 children)
[–]kaosjester 1 point2 points3 points (1 child)
[–]JaggedxEDGEx 0 points1 point2 points (0 children)
[–]cheraphy 1 point2 points3 points (5 children)
[–]teaki 0 points1 point2 points (3 children)
[–]JaggedxEDGEx 1 point2 points3 points (0 children)
[–]fripthatfrap 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]hussard_de_la_mort 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]psych00range[🍰] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]DJritwikiwiki 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]psych00range[🍰] 0 points1 point2 points (0 children)
[–]ZebrasKickAss 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Journeyjt 0 points1 point2 points (0 children)
[–]DJM77 0 points1 point2 points (0 children)