Cheating Network
 
 

Go Back   Cheating Network > General Computing > Programming > Tutorials / Releases
Reload this Page Loops in C++



Tutorials / Releases

This is a discussion about Loops in C++ within the Tutorials / Releases section, where you will Any tutorials or releases should be posted here.



Reply
 
LinkBack Thread Tools Display Modes
Old 12-14-2007, 08:10 PM   #1 (permalink)
Senior Member
 
CauseISaidSo's Avatar
 
Join Date: Dec 2007
Posts: 149
Reputation: 0
CauseISaidSo is an unknown quantity at this point
Send a message via AIM to CauseISaidSo Send a message via Yahoo to CauseISaidSo
Default

This tutorial will show you how to loop statements in c++, you should know basic c++ before trying this

Definition: A loop is a way of repeating a statement a number of times until some way of ending the loop occurs. It might be run for a preset number of times, typically in a for loop, repeated as long as an expression is true (a while loop) or repeated until an expression becomes false in a do while loop.

There are three types of loops
-Do-While
-While
-For

All three have their importance and uses.
A do-while loop is used to run the loop once and then check conditions
A while loop checks the conditions before the loop is executed and decides if the loop needs to be run
A for loop is an increment counter used for a specific amount of outputs

All three loops are in this code:
[codebox]#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
cout
__________________
Someday I'm gonna write a song thats gonna be so popular, everybody hates it


If you guys could help me out with this it would be awesome!
http://www.FlashiPods4free.com/index.php?ref=38639
CauseISaidSo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-14-2007, 08:38 PM   #2 (permalink)
Junior Member
 
Join Date: Dec 2007
Posts: 28
Reputation: 0
xgamex is an unknown quantity at this point
Default

Nice Tutorial... Keeps it short and to the point.
xgamex is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-14-2007, 09:04 PM   #3 (permalink)
Senior Member
 
Join Date: Jan 2008
Posts: 2,966
Reputation: 62
Slingshot377 will become famous soon enough
Default

Maybe provide short definitions for each loop?
__________________
Slingshot377 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-14-2007, 09:06 PM   #4 (permalink)
Senior Member
 
Guo0's Avatar
 
Join Date: Dec 2007
Posts: 660
Reputation: 18
Guo0 is on a distinguished road
Default

lol, we just learned this in my school last week xD

i still dont get nested loops
__________________
Guo0 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-14-2007, 09:55 PM   #5 (permalink)
Junior Member
 
Join Date: Dec 2007
Posts: 28
Reputation: 0
xgamex is an unknown quantity at this point
Default

What do you not get about nested loops? Maybe I can explain...
xgamex is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-03-2008, 10:51 AM   #6 (permalink)
Junior Member
 
Join Date: Dec 2007
Posts: 9
Reputation: 0
FlyingIsFun1217 is an unknown quantity at this point
Default

Nested loops: do something until condition is met, usually do something else, repeat.

I prefer to just:

<div class='quotetop'>QUOTE </div>
Quote:
bool done = false;

while(done = false)
{
//do stuff, eventually set done to true
}[/b]
Just showing my method.
FlyingIsFun1217
FlyingIsFun1217 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
loops


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBulletin
Copyright © 2000-2008 Jelsoft Enterprises Limited.
Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.