You are not logged in.
Pages: 1
I once claimed in some forum that the following code in C is an infinite loop:
#include <stdio.h>
int main(void) {
char i;
for (i=0; i <256; i++)
printf("%d\n", i);
return 0;
}
How is this program an infinite loop? Unless char I doesn't increment because it's a character and not an integer.
Before I go ahead and answer that question, I personally encourage you to actually put this in a compiler and run the code for yourself and check that it indeed is an infinite loop.
I don't have a compiler, but I know enough about coding to know that for loops shouldn't be infinite loops. So if it doesn't output integers, then it must be an error of sort.
What?! How can someone not have a compiler but *know enough about coding*?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Hi;
Did you tell him that there are online compilers for him to use?
What?! How can someone not have a compiler but *know enough about coding*?
I guess you have missed all my rants, bafflers and brittle posts... Is that possible?
Either how canst thou say to thy brother, Brother, let me pull out the mote that is in thine eye, when thou thyself beholdest not the beam that is in thine own eye?
Let us assume that I have already done that? Of course, that is kaboobly doo but let us act as if I am not guilty of that too.
Here are my reasons:
1) People want to live and play by cliches. Rooks belong on the seventh rank, never bet into an open pair, math holds the key to the universe and God is a geometer, we are God's special little creature and have dominion over the earth to do with it as we please, etc. You have heard these too.
It makes things simple and easy to understand when we live by cliches. You do not have to think, you do not have to calculate, you do not have to experiment. You only have to look up this particular example in the big book of cliches. Just read what it says and do it, oh, do not forget to kick anyone else in the face hard if he dares go against those cliches. Or, if kicking is not to our taste today, let us lock him up and stuff him full of medication until he thinks the way we do, the right way.
Your friend there, thinks he knows everything and why not? He bought the big book of cliches, turned to chapter 1252 which is about programming and gave you the benefit of its vast knowledge. Do you not recognize this behavior on math forums all the time?
People are slow to learn and even slower to change. Why are they obstinate? They are people, that is why.
2) Now that we got that kaboobly doo out of the way we can look at the real reason. The king of all such people is you know who. It is dismissive and a cliche to assume that such people are insane. It is quick and easy and we can put the real reasons out of our mind and watch TV or eat and watch TV. Which I am going to do right now, that book of cliches is coming in handy, think I will buy the abridged version.
3) This runs okay, at least it terminates.
#include <stdio.h>
int main(void) {
int i;
for (i=0; i <256; i++)
printf("%d\n", i);
return 0;
}
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
You are right. I should tell him about online compilers.
No, I didn't miss the rants. Is that even possible?
That code is fine. But the point of my code was to demonstrate an overflow
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Yes, even a bumpkin can understand. That is the problem, he is an expert, not a bumpkin.
You look a little thin, have you been eating?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
You look a little thin, have you been eating?
What are you talking about?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Your picture looks a bit thin.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Not really, does it?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Could be my imagination.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Pages: 1