Added: 3 years ago
From: antiRTFM
Views: 22,376
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (60)

Sign In or Sign Up now to post a comment!
  • WHOOT!!! Finally , the awesome code of "loops". :D

  • where is 20 and 21?

  • The best!

  • could you use ==2 or another int to increase by more than one

  • @LordOfMedusa it wouldnt be ==2. it would be

    for ( int i = 0;

    i < 10;

    i+=2

    ){}

    Sry had to separate it because youtube doesn't allow code

  • for some reason every time i go to sleep since i watched this video i hear countless whispers inside my ear "hello world...!" x_x

  • Wonderful stuff man... Very helpful!

  • Is there any way to have a variable specified BEFORE the loop? like if you have the user write a # then that number is the number of times the loop reruns?

  • Im a bit stuck.. why doesn't this display a list of numbers as it counts up?

    int main()

    { for (int counter = 0; counter <10; counter++ ); { cout << counter; cout << "\n"; }

    missed out the normal extra stuff to save space..

  • @Vortigon

    The problem is the third semicolon. After the for() you should have the block {...}.

    What the third semicolon is doing is ending the for() expression (when in fact you're not done yet, you want to put code in it).

  • Amazing, very good. Everytime u mention of more info videos on the right section for practice. But can't find any with the title u mentioned.

    Is there a possibility of having ur video tutorial cos my internet is slow so i would like to save them for future reference. Thanks mate

  • Great tutorial! And your english is good.

  • I can make that everytime it loops it call a function? like this:

    for (int = x; x <100; MyFunc(); && x ++)?

    this would spam MyFunc(); 100 times right?

  • Just curious. The text will be displayed 99 times right?.. since you gave "counter < 100" .. i guess if it were "counter <= 100" .. it would've displayed 100 times..

  • @skoushik333 No, it will be displayed 100 times, because the counter starts at 0, not 1.

  • @tahayassen Ah.. I see.. Thanks for the reply :-)

  • what is the advantage of  a for loop as opposed to a while or do while loop?

  • Comment removed

  • @mistahowe It's mainly preference. Most programmers use for loops to do counters, and use other looping necessities with while loops.

  • Small correction for the start:

    Video information is now, thanks to youtube, below the video.

    To the right of the video are some advertisements we all hate.

  • what was the forum's name again ?

  • @the6aces see video info

  • Hi antiRTFM there is a semicon after 9, Is it mistake?

  • @arcaniumb What 9?

  • Hello antiRTFM!!! This video is excellent and I enjoy it.

    I already know some C++ but this makes learning easier for me cause I'm visual learner. However, I can't find the practices that you are referring to in video #22. Is it still available?

  • I really enjoyed the videos up untill now Anyway I had a question when I use counter + 1 instead of ++ the loope is infinite. Why can't you use + 1.

  • 1) you probably didnt assign anything to your 'counter' yet so it acts crazy. Never use a variable before initializing it with a value!

    2) "counter + 1" will never keep counting up higher and higher until its time to stop. the ++ operator counts it up.

  • @89myacc  you can use +1

  • @89myacc to do it like that you need counter=counter+1

  • i have inserted 2 conditions in the loop one of them been ignored

  • see my channel FAQ #3 and #2

  • it would be funny if you named the counter variable "C" then it would have been

    for ( int = C ; C<100 ; C++)

  • you could name the counter variable c, no reason why you cant.

  • lol possibly the geekiest joke ever. points++

  • that was epic, gamma XD

  • @gamma526 you mean int C = 0

    -_-

  • isnt loop the very basic foundation for game creation ?

  • Yeah, but not this kind of loop, for loops go instantly all in one frame, you need a loop that goes once every frame.

    Not sure how to do that in c++

  • Im curious, what do you mean "you need a loop that goes once every frame."?

  • You type in a 100000000 for one of those and you made an exe that can give someone a seizure.... Funny funny funny funny funny lololol

  • Legend :D!

  • i didnt know uptill now, what's the difference between a float and a double i cout them 1.23456789, and the float gave me like the double, which is 1.234567, i need an answer asap thx nice videos u r a GREAT teacher !!!

  • doesnt work in Dev C++

  • what doesn't?

    and by the way, Dev C++ is widely looked down upon for countless reasons, especially when we have the free Visual C++ Express for PC and Xcode for MacOS

  • I typed it out how it looks into the programmer and nothing ran it gives me errors in the cout area

  • see my channel's FAQ for your response;

    code 3, code 2

  • i just use it coz its small

  • it worked for me in Dev c++

  • im looping =)

  • So what's the difference between making a variable within a function, structure, union or a class's parenthesis and making them within their brackets?

  • all have their purposes, as explained in the videos

  • I can't go on for today. pluss is thanks giving day so a break is ok.

  • So what would happen if you typed.

    [CODE]

    for (const int counter = 0; counter < 10; counter++)

    [/CODE]

    Would this just loop forever or would there be an error?

  • This code cannot compile because you cannot perform "++" upon a constant variable

  • All right thanks a lot! I didn't want to run this and find it stuck in an infinite loop or something.

  • Love your vids.

    they are very helpfull

    i was wondering if there was any reason why you use cin >>f; to keep the program up, instead of system("PAUSE"}

  • system("pause"); is not standard C++ as you will see in future videos

  • In Tutorial 22 you are mentioning a forum where you have put some exercises. I am really not being able to find it. Would anyone please advise on that?

  • its in the video info

    (click on "more info")

  • Thank you so much for dedicating your time making these videos and sharing of your knowledge.

  • how log do you think it will take me to make a simple platform game with my currnt C++ knowledge? (this is the latest tutorial ive seen)

  • harrumpf.... a long time :)

    truth is, it all depends on what kind of game. you can begin making little text-based games now (see the forum for some examples), but huge 3D games will be another LONG time...

  • you are doing a great job!!! I'm learning so fast. I think it's even better that my class in Miami Dade college.

    I really appreciate what you are doing!!!!

    Thanks.

  • thanks, and keep it going :) !

  • do you think you will get to pointers somewhere in your videos

  • sure. i am thinking of making it my next video (#41) im just trying to figure out how ro make YouTube HQ vids...

  • i think it has the HQ option when you record it on a bigger resolution. ( from what i've seen on my videos) A movie of 640x480 and bigger, uploaded on youtube, should have the hq option.

  • can you break or exit the loop somewhere inside the { } ? with using an if statement inside?

  • yes, as we will learn about the 'break' statement

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more