| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Loops; The Loops of C and C++ | |
|---|---|
| Tweet Topic Started: Jul 26 2008, 04:59 AM (409 Views) | |
| Rexhunter99 | Jul 26 2008, 04:59 AM Post #1 |
|
Elite Member
![]() ![]() ![]() ![]() ![]() ![]()
|
Okay, Im still new to the whole C programming thing, and I know how hard it is to program in. My first tutorial is on Loops: WHILE example code:
Its commented well, so theres no reason you shouldn't understand it. A while loop can be used for many things and is very handy, here the code is simply repeating 100 times (0-99) and printing some text into the windows console. ----------------------------------------------------------------------- FOR example code:
Its very much like a while loop only when you call it, you can define what the variable is equal to at the start of the loop every time. A for loop can be used for as many things as a while and is good for grid-like systems, here the code is simply repeating 100 times (0-99) and printing some text into the windows console again. ----------------------------------------------------------------------- DO loop coming soon. Edited by Rexhunter99, Jul 26 2008, 05:23 AM.
|
![]() AI = 0% Environment = 50% Renderer = 15% Multiplayer = 0% Menus = 0% Models = 2% Maps = 5% Total = 11% | |
![]() |
|
| Bazza | Jul 26 2008, 06:15 AM Post #2 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
there is also the do loop for things u want to run at least once
Edited by Bazza, Jul 26 2008, 06:18 AM.
|
| My instinct is to hide in this barrel, like the wily fish. | |
![]() |
|
| Rexhunter99 | Jul 26 2008, 08:42 AM Post #3 |
|
Elite Member
![]() ![]() ![]() ![]() ![]() ![]()
|
Yes, problem is I have never used a DO loop, even in gamemaker. I need to work on DO loops a little more, then Ill add this to my C++ for Beginners tutorial. What did you think of the explanation/examples so far? |
![]() AI = 0% Environment = 50% Renderer = 15% Multiplayer = 0% Menus = 0% Models = 2% Maps = 5% Total = 11% | |
![]() |
|
| Bazza | Jul 26 2008, 08:57 AM Post #4 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
informative and to the point **applause** i just thought ide throw in teh do loop |
| My instinct is to hide in this barrel, like the wily fish. | |
![]() |
|
| Rexhunter99 | Jul 26 2008, 09:21 AM Post #5 |
|
Elite Member
![]() ![]() ![]() ![]() ![]() ![]()
|
Yep, ty. |
![]() AI = 0% Environment = 50% Renderer = 15% Multiplayer = 0% Menus = 0% Models = 2% Maps = 5% Total = 11% | |
![]() |
|
| « Previous Topic · Tutorials · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)




9:02 PM Jul 11