[Source]FOR Loops

Posts 1–14 of 14 · Page 1 of 1
[Source]FOR Loops
For people that want to learn a for loop, we will be using the WIN32 Console Application for pure C++ code.

Now I will only explain the loop part.

Code:
#include <iostream>
using namespace std;

int main()
{
  int Thing;

  for(Thing=1; Thing<=100; Thing=Thing+1)
      cout << thing << " ";

  return 0;

}
now that will display numbers 1-100 on the screen.

So what is happening is, It makes Thing become 1 then if thing is less then or equal to 100 do what it is currently and add 1 so, if its 1 its less it will take 1 and add 1 becomming 2, and so on and so forth till it is equal too 100, then it will stop.
Quote Originally Posted by HypnoticBabeTrap View Post
Code:

  for(Thing=1; Thing<=100; Thing=Thing+1)
this isn't C++ this is C=C+1
Quote Originally Posted by lalakijilp View Post
this isn't C++ this is C=C+1
I don't think you can use namespaces in C.
Why do something about this guy please He's spamming the forums with random bullcrap that he calls tutorials and expects us 2 give credits for copy pasting parts of a C++ book
Quote Originally Posted by Hell_Demon View Post
Why do something about this guy please He's spamming the forums with random bullcrap that he calls tutorials and expects us 2 give credits for copy pasting parts of a C++ book
Books actually explain something.
Quote Originally Posted by Void View Post
Books actually explain something.
he c+p's the code, calls it a tutorial and posts it

Buying a book is probably cheaper, that guy is wasting bandwidth with all those posts on such simple things.
....Okay, I don't mind the part with the tutorials. But jesus, like Hell_Demon said, stop making like 4 threads. YOU DON'T EVEN NEED THAT MANY. @_@
Quote Originally Posted by HypnoticBabeTrap View Post
Code:
Thing=Thing+1
LOL.

Thing=Thing+1?

If he copied this from a book, then the author must have been a retard.
Quote Originally Posted by Lolland View Post
LOL.

Thing=Thing+1?

If he copied this from a book, then the author must have been a retard.
I'm not agreeing with his tutorials, but, I believe he was trying to make it as simple as possible. Instead of using the increment operator.
Quote Originally Posted by Void View Post
I'm not agreeing with his tutorials, but, I believe he was trying to make it as simple as possible. Instead of using the increment operator.
Code:
#include <iostream>
using namespace std;

void main(void)
{
    char *Failstr1 = "Thing=Thing+1;";
    char *Failstr2 = "Thing++;";
    size_t *f1len = strlen(Failstr1);
    size_t *f2len = strlen(Failstr2);
    if(f1len<f2len)
    {
        cout<<"Are you nuts? since when is "<<Failstr<<" shorter then "<<Failstr2<<"?!?!?"<<endl<<"FUCKIN RETARD";
    }
    else
    {
        cout<<"Indeed, "<<Failstr2<<" is much more simple then homo VBfag "<<Failstr1<<endl<<"cookies for you :D";
    }
}
Can my cookies be chocolate chip?
Quote Originally Posted by HypnoticBabeTrap View Post
For people that want to learn a for loop, we will be using the WIN32 Console Application for pure C++ code.

Now I will only explain the loop part.

Code:
#include <iostream>
using namespace std;

int main()
{
  int Thing;

  for(Thing=1; Thing<=100; Thing=Thing+1)
      cout << thing << " ";

  return 0;

}
now that will display numbers 1-100 on the screen.

So what is happening is, It makes Thing become 1 then if thing is less then or equal to 100 do what it is currently and add 1 so, if its 1 its less it will take 1 and add 1 becomming 2, and so on and so forth till it is equal too 100, then it will stop.
if you really want to make a tutorial about loops, first of all you should talk about do-while & while, then about FOR().

and the way you explained it was kinda........

You just said the obvious that anyone could see just by coping the code and test it. You are not even explaining what you need inside the for(xxxxx)... or not.
i got tutorial for u buddy
Code:
#include <iostream>
using namespace std;

int main()
{


for(;;)
cout<<"GTFO"

      

  return 0;

}
u see my signature thats me kicking your face with ^
[php]

#exclude <brain>
using namespace fucknamespaces$

retard main()
{
see"I r retard"$
ask" r u retard?"$
kbai$
if(faguser answer yes){
repeat code until dead$
}
return retardation$
}

[/php]

My code is somewhat a new language.
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us