Let's get programmy!
- redangelran
- inlove with a mystery geek || is stalking someone
Posts: 1530
Re: Let's get programmy!
$25

"I don't mind waiting for people. Because the longer you wait, when you do meet, you'll be more happy."
-Mouri Ran
"Is a reason necessary? I don't know why you would kill someone but as for saving someone-- a logical mind isn't needed, right?"
-Kudo Shinichi
My Twitter||My MAL
-super stupid case fanatic, i'm waiting for you ♥-
-Mouri Ran
"Is a reason necessary? I don't know why you would kill someone but as for saving someone-- a logical mind isn't needed, right?"
-Kudo Shinichi
My Twitter||My MAL
-super stupid case fanatic, i'm waiting for you ♥-
-
ranger
- Community Villain
Posts: 3588
-
Akonyl
- Community Hero
Posts: 4200
Re: Let's get programmy!
clearly that guy should just learn to stop using deprecated functions/headers, geez. 
I do like the two guys high-fiving over the mushroom cloud though.
I do like the two guys high-fiving over the mushroom cloud though.
- Kirbypepe
- Wonder what I'll turn into =D
Posts: 135- Contact:
Re: Let's get programmy!
^ =PAkonyl wrote: clearly that guy should just learn to stop using deprecated functions/headers, geez.![]()
And Yeah I liked the flubber thing though that was funny
oh and
http://www.youtube.com/watch?v=b-Cr0EWwaTk
Last edited by Kirbypepe on October 24th, 2011, 10:17 am, edited 1 time in total.
Howdy Everyone=]
Things are fantastic. How about for you?
Thats cool.
Wait I just realized, who am I talking to????
Things are fantastic. How about for you?
Thats cool.
Wait I just realized, who am I talking to????
-
Akonyl
- Community Hero
Posts: 4200
Re: Let's get programmy!
lole
I'm suddenly reminded of all the stupid bugs I've had to fix, this one in particular from a guy I knew
infinite looped
best bug ever
I'm suddenly reminded of all the stupid bugs I've had to fix, this one in particular from a guy I knew
Code: Select all
int main()
{
//declarations
int array[10];
//initialization
int i;
for(i=0; i<=10; i++)
{
array[i]=0;
}
return 0;
}
best bug ever
- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
I had also called that to be faulty, but because of the ArrayIndexOutOfBoundsException it generates when i becomes 10...Akonyl wrote: I'm suddenly reminded of all the stupid bugs I've had to fix, this one in particular from a guy I knew
infinite loopedCode: Select all
int main() { //declarations int array[10]; //initialization int i; for(i=0; i<=10; i++) { array[i]=0; } return 0; }
best bug ever
Also, is this Java?
If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive
This link provides further information.
Callid Conia Pact - Petitions - Archive
-
Akonyl
- Community Hero
Posts: 4200
Re: Let's get programmy!
it's a C/C++ bug, Java won't do it because it won't let you index out of arrays.
if it was java, it'd be a public static int main() anyway
if it was java, it'd be a public static int main() anyway
- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
Ah, IC. Still, I don't quite get where the loop comes in -.-Akonyl wrote: it's a C/C++ bug, Java won't do it because it won't let you index out of arrays.
if it was java, it'd be a public static int main() anyway![]()
Actually, it's perfectly possible to have a method called "int main()" in Java, if the method is simply a non-public and non-static one. Actually, the reason I figured it wasn't Java was because of the array declaration, which would have looked way different in Java
Also, considering that this method being an int is completely pointless (actually, isn't the method as well?), am I right to assume that C/C++ does not have voids?
If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive
This link provides further information.
Callid Conia Pact - Petitions - Archive
-
ranger
- Community Villain
Posts: 3588
Re: Let's get programmy!
wanna know an easy way to know it was C/C++ rather than java?
he/she didn't put "int i" in the for loop, C doesn't let you do that shit
he/she didn't put "int i" in the for loop, C doesn't let you do that shit

- Kirbypepe
- Wonder what I'll turn into =D
Posts: 135- Contact:
Re: Let's get programmy!
No you can have voids
is perfectly valid in c++. Although I know that a lot of people prefer it to be int main.
Code: Select all
void main()
{
//do stuff here
return;
}
Howdy Everyone=]
Things are fantastic. How about for you?
Thats cool.
Wait I just realized, who am I talking to????
Things are fantastic. How about for you?
Thats cool.
Wait I just realized, who am I talking to????
- Conia
- Yurikochan's Husband
- Conan Shuuichi
Posts: 5194
Re: Let's get programmy!
You mean like:ranger wrote: wanna know an easy way to know it was C/C++ rather than java?
he/she didn't put "int i" in the for loop, C doesn't let you do that shit
for (int i=0;i<=10;i++)
{
cout<<i;
}
?
Cause I do that all the time so it is possible

-
ranger
- Community Villain
Posts: 3588
Re: Let's get programmy!
For most compilers before C99 you can't initialize the variable in your for loop for C, you can however in C++Conia wrote:You mean like:ranger wrote: wanna know an easy way to know it was C/C++ rather than java?
he/she didn't put "int i" in the for loop, C doesn't let you do that shit
for (int i=0;i<=10;i++)
{
cout<<i;
}
?
Cause I do that all the time so it is possible![]()
edit: sorry, my wording was kinda confusing before, but basically its easy to identify C because by just looking at the for loop variable initialization. and Yeah you can do it in C++, like in your example above
Last edited by ranger on October 24th, 2011, 2:45 pm, edited 1 time in total.

-
Akonyl
- Community Hero
Posts: 4200
Re: Let's get programmy!
because if you didn't have a loop, how would you have the program loop infinitely?Callid wrote: Ah, IC. Still, I don't quite get where the loop comes in -.-
as for the purpose of the loop, of course it has no function in the example I used, but I was just putting in the part of the code necessary to replicate the bug (the part where he was initializing his array).
as for voids, while void functions are perfectly valid, void main() is different. Depending on the standard (C vs C++), void main() may or may not be allowed (specifically, you're allowed to do it in C but not C++ based on the ISO standard and g++ will yell at you if you attempt to compile a void main()), more on that hereif you actually care. It's there so that upon process completion the process can report its condition back to the calling script/whatever (Just like System.exit(int) in java), but I've never actually used it for that purpose, it's just habit now.
@ranger: Not sure if it's only some or all, but even in some C compilers (gcc) you can define your vars inside your loop anyway, I just chose not to.
-
ranger
- Community Villain
Posts: 3588
-
Akonyl
- Community Hero
Posts: 4200
Re: Let's get programmy!
why's this topic on page 3 I mean geez guys :<
aside from page 3 topics, know what else makes me sad? When you write some code for later use, and when you get to the point where you can use it it turns out that it doesn't actually do what you need to so you need to hope you can overhaul it or have to rewrite it. D:
aside from page 3 topics, know what else makes me sad? When you write some code for later use, and when you get to the point where you can use it it turns out that it doesn't actually do what you need to so you need to hope you can overhaul it or have to rewrite it. D:
