Buckys C++ Programming Tutorials - 18 - while Loops

  Рет қаралды 643,957

thenewboston

thenewboston

Күн бұрын

Пікірлер: 373
@laurelclementedinopol3615
@laurelclementedinopol3615 9 жыл бұрын
Damn... I've been watching your tutorial and I've learned a lot than staying in my classroom.. best part is.... It's FREE! Thanks a lot buck
@__Suyash
@__Suyash 8 жыл бұрын
+Laurel Clemente Dinopol my teacher wanna get me thinking that "damn ,my teacher is so smart" but nope.....
@Sisa095
@Sisa095 2 жыл бұрын
same
@halleyhart7161
@halleyhart7161 4 жыл бұрын
Yoo bucky bucks, cool tutorials. Still here 2020
@anthonystevens6999
@anthonystevens6999 3 жыл бұрын
Still here 2021
@Sakura69
@Sakura69 2 жыл бұрын
Still here 2022
@saku-ra8813
@saku-ra8813 2 жыл бұрын
Still here 2022 almost 2023
@themask7795
@themask7795 Жыл бұрын
Now 2023 like if you still here❤
@oriavni3622
@oriavni3622 10 ай бұрын
2024
@Mooniscool-w8g
@Mooniscool-w8g 10 жыл бұрын
cout
@rogueonlict1740
@rogueonlict1740 5 жыл бұрын
string name; cout
@dearshoberoi285
@dearshoberoi285 5 жыл бұрын
Why not add that line in a while loop?
@rogueonlict1740
@rogueonlict1740 5 жыл бұрын
@@dearshoberoi285 ok buddy thanks yo dope
@poorgang
@poorgang 5 жыл бұрын
@@rogueonlict1740 while(1){ cout
@pixies9145
@pixies9145 4 жыл бұрын
Its strange he uploaded these videos when I were in grade 4,now I'm a university student ... amazingly, good effort to teach a lot of people .God bless u :)
@toyosi2590
@toyosi2590 3 жыл бұрын
same
@omarr.5371
@omarr.5371 8 жыл бұрын
Bucky, you cannot begin to imagine how grateful I am for your tutorials. Thanks for the time you spent and all the work you put into them. Really! THANKS!
@btc1668
@btc1668 10 жыл бұрын
the best c++ teacher on youtube. thank you Bucky
@nightcoreislove2029
@nightcoreislove2029 8 жыл бұрын
you can use bacon++ instead of bacon = bacon + 1; bacon++ add 1 to bacon everytime bacon++ is called
@erlydeth99
@erlydeth99 6 жыл бұрын
Could also use bacon += 1; if you're just looking for acceptable variants.
@SNoCappidona
@SNoCappidona 2 жыл бұрын
i love when bucky says "pretty cool, huh?"
@ethanviolet1
@ethanviolet1 6 жыл бұрын
If you don't want to type: bacon = bacon + 1, you can type: bacon++ it is just a shorthand for incrementing by one.
@ananavarro6639
@ananavarro6639 19 күн бұрын
Thanks so much for this explanation! Helped a lot! I was getting confused with my course and so I needed another reference point. You made it easy to understand, I appreciate that so much! Now I can continue learning more C++ with confidence!
@muhammadamirulasyraf5816
@muhammadamirulasyraf5816 8 жыл бұрын
"Pretty cool huh".... hell yeah!!! thanks a lot man
@ninaramirez6237
@ninaramirez6237 6 жыл бұрын
Some people are born to be helpful. Thanks a Lot bucky!!!!
@dee4960
@dee4960 2 жыл бұрын
Thank you so much for these tutorials. You explain it so much better than my instructor.
@OldAlley
@OldAlley 3 жыл бұрын
My only issue is, there can never be enough bacon..
@thee_fairysister2329
@thee_fairysister2329 Жыл бұрын
Thank you so much Bucky, your channel has made coding so fun and easy
@barinoodumcelestine1767
@barinoodumcelestine1767 4 жыл бұрын
Hi Mr Buckys you are one in millions, you are just like a God sent. Thanks for all your tutorial videos, they're really good. God bless you.
@church778
@church778 12 жыл бұрын
For those wondering, you can also increase or decrease by more than just one. You can use, for example, x+=2; which will increase x by 2 everytime its ran. Replace the + with each different operator sign for desired effect.
@saifurrahman37
@saifurrahman37 7 жыл бұрын
It was something that I had been looking for a couple of months.Thanks.
@jackturisma237
@jackturisma237 11 жыл бұрын
In case you don't know you can also use "bacon++;" for adding one everytime you loop thru while loop
@steve122288
@steve122288 8 жыл бұрын
gad damn. Searching syntax led me on a never ending wikipedia adventure, yet again.
@Aydinwxz
@Aydinwxz 8 жыл бұрын
haha same here
@abboudashkar3804
@abboudashkar3804 5 жыл бұрын
my teacher told us to watch your videos
@coreydoyle4702
@coreydoyle4702 11 жыл бұрын
It's very nearly a complete university for FREE! THIS is the future of education. Free, Open-Source, and Collaborative. Universities and Colleges? Archaic institutions from the past. -Cheers
@joetomaselli8084
@joetomaselli8084 11 жыл бұрын
An easy way to bypass this is to keep a log of what you learn. I have a folder for every 5 C++ videos, and in the folder is a word doc about a singular lesson. It helps!
@slamg478
@slamg478 2 жыл бұрын
Hey bucky! Just want to say that im glad that i found your channel, today my lecturer said to me that im not gonna be a good programmer although that is my ambition, I hope that you all can wish me luck in the coming years !! Thanks🤕
@ferasyakan2558
@ferasyakan2558 2 жыл бұрын
Don't listen to him and pursue your dream
@_0_restart_0_
@_0_restart_0_ Жыл бұрын
Good luck, Haziq!
@vectork3
@vectork3 7 жыл бұрын
Thanks bucky you are master at c++ ang teach very well I learned a TON of new things about c++ than my teacher!
@nikitasingh2134
@nikitasingh2134 4 жыл бұрын
Approx 2021, its going to be 10 years and everyone still watches these.
@togmeister8604
@togmeister8604 9 жыл бұрын
Lol? Why is your project in a folder called Watermelon.
@SLRNT
@SLRNT 9 жыл бұрын
Togmeister he's doing these tutorials the fun/creative way, calling classes bacon, apples etc :)
@SLRNT
@SLRNT 9 жыл бұрын
Togmeister he's doing these tutorials the fun/creative way, calling classes bacon, apples etc :)
@SLRNT
@SLRNT 9 жыл бұрын
Togmeister he's doing these tutorials the fun/creative way, calling classes bacon, apples etc :)
@logerer5633
@logerer5633 9 жыл бұрын
MasterSteve26 And you've posted this three times :P
@SLRNT
@SLRNT 9 жыл бұрын
KZbin app on a smartphone... y'know, imma delete them :D edit: wut :DDD can't even delete them :DD
@sdmvx
@sdmvx 8 жыл бұрын
Pretty cool huh!!
@nightfreespirit
@nightfreespirit 11 жыл бұрын
Thank you for these great tutorials. Even I am Danish, I understand them and is learning :)
@isaacdomino9548
@isaacdomino9548 3 жыл бұрын
int bucky = 0; while (bucky
@Klipperino108
@Klipperino108 10 жыл бұрын
If you wanna add 1 to bacon, you could just write bacon++ right?
@1990jmv
@1990jmv 10 жыл бұрын
yes
@beri4138
@beri4138 7 жыл бұрын
Or ++Bacon. Does the same thing.
@Silentstrike46_
@Silentstrike46_ 7 жыл бұрын
@Gaming Turkey, Slight difference: If you are doing multiple steps in one, the location of the "++" can lead to different outcomes. If the '++' is before the variable, it will increment the variable before using it, not after. For example: bacon = 10 Cout
@chemiller8814
@chemiller8814 8 жыл бұрын
Thanks for the help going through programming fundamentals and this is helping
@iXenoCider
@iXenoCider 12 жыл бұрын
Well for loops have much more power then while loops, let me show you. Say you have an array of names, you could put this in a for loop for(int i =0; i < NamesLength; i++) { cout
@sourpatch_king
@sourpatch_king Жыл бұрын
great stuff mate! easy to follow and to replicate. Thank you for the help!
@bradtagegogona7076
@bradtagegogona7076 6 жыл бұрын
yess !! this is exactly what i need !! Thanks buck...simply pro
@Boomerlance
@Boomerlance 12 жыл бұрын
Instead of putting bacon = bacon + 1; you could have simply used: bacon++; way easier,this is called a COUNTER,it increase one unit to the variable once the first loop ended and then it ask again until the while loop ends. other than that,great video,thanls to you,i know Java and C++ in a few months imma learn visual basic......you know,college really know how to test your patiente =S
@Boomerlance
@Boomerlance 12 жыл бұрын
yup,thats another alternative,but the tutorial was about the while loops.. personally,i think that while and for are basically the same thing,but for is better in more complex programs and the while loop's better in simple programs IMO...
@briansummers2670
@briansummers2670 10 жыл бұрын
Now teach us bacon++
@maroofraktim293
@maroofraktim293 6 жыл бұрын
The way you teach is awesome..
@creedgamer7138
@creedgamer7138 3 жыл бұрын
wow Bucky your explanations are awesome.....
@weexism
@weexism 10 жыл бұрын
Thank you!! You're awesome. You should be teaching my CS161 class.
@TheMorhaGroup
@TheMorhaGroup 2 ай бұрын
Take a breath bucky, you're fucking amazing
@TheHTMLCode
@TheHTMLCode 12 жыл бұрын
yes you can, I think bucky is just demonstrating in its most basic form for those who find these abreviations hard
@laroselcouth8522
@laroselcouth8522 4 жыл бұрын
So useful for classes... thank you!
@letsexecutecplusplus7261
@letsexecutecplusplus7261 4 жыл бұрын
Bucky's all tutorial 👌👌👌 Still yet thanks Bucky
@jrarmas321
@jrarmas321 8 жыл бұрын
I like how people are posting their codes, while i can't understand all of it I Sure will sooner or later.
@__Suyash
@__Suyash 8 жыл бұрын
guess what !!,i made an freaking bomb timer !!!BOOOM
@keepcalmandgo6169
@keepcalmandgo6169 2 жыл бұрын
OMG, it really worked. Thank you so much!!
@astraadamskhan1399
@astraadamskhan1399 10 жыл бұрын
very helpful thank you love these tutorials
@stroyed4229
@stroyed4229 8 жыл бұрын
For anyone who sees this a while loop that never stops can be useful. If you make something in main like: int main() { while (1) { } } You can keep the program open until you tell the loop to break or until the user exits the programs.
@Gbyter
@Gbyter 8 жыл бұрын
You can prevent the console from closing by adding a random int variable, then adding a cin >> (random variable) at the end of the code. int mani() { int randomvariable; CODE CODE CODE CODE CODE cin >> randomvariable; }
@defalergod
@defalergod 12 жыл бұрын
While this is useful you can only do it once, for instance. cout
@HowToCompute
@HowToCompute 8 жыл бұрын
Hi, I would like to point out for what you are doing here a for loop is better suited. So instead of typing bacon = bacon + 1; bacon++; (will increment by one) or bacon += 1 (will add 1 to the value, can also be another value than 1, also possible as -= to subtract!)!
@TheLostEggroll
@TheLostEggroll 7 жыл бұрын
wow, now i understand how video game exploits work thnx!
@SuperSneakyPanda
@SuperSneakyPanda 13 жыл бұрын
@benningtonguySTUDIOS ++bacon will add 1 to bacon before evaluating it. bacon++ will evaluate it as bacon THEN it will increment bacon.
@2k6brandon
@2k6brandon 13 жыл бұрын
At the end of the while loop what is the value of bacon? example: at 3:14, if you were to use the variable bacon after the while loop, would bacon still be 0 or would it be changed to 6?... If you were to cout
@metznimbo29
@metznimbo29 13 жыл бұрын
@crjacinro Id keep wacting this one, I hav watched the other one for dev C++ (not codeblocks) and this one is a lot better and MUCH longer
@1USF
@1USF 8 жыл бұрын
thumbs up you worth it
@herantd
@herantd 8 жыл бұрын
for instance if you working on code for your microcontroller you want a loop run for ever. like pulsing LED on the arduino.
@jesusiskingofkings4428
@jesusiskingofkings4428 Жыл бұрын
thank you good sir and God bless everyone
@gigahertzish
@gigahertzish 11 жыл бұрын
he doesn't want to confuse people who might be watching this video because it's geared towards people with average intelligence and no prior knowledge, not programmers.
@MosaabMop
@MosaabMop 11 жыл бұрын
thaaanx alot.helped alot keep going ;)
@calccalccalc
@calccalccalc 13 жыл бұрын
Just a tip: A tidier way of adding 1 to a variable is: x++; Just so ya know ;D
@zeonos
@zeonos 12 жыл бұрын
you can also do "bacon++;" it will add 1 for each pass.
@stephaniemsegura09
@stephaniemsegura09 3 жыл бұрын
Great job explaining!
@kezzibaba
@kezzibaba 10 жыл бұрын
BUCKY IS THE BEST!
@muk3shbeats
@muk3shbeats 9 жыл бұрын
can somebody help.. whats the difference bw ++bacon & bacon++ ?? both adds 1..so does it makes any difference? (i am hella confused)
@appio4345
@appio4345 9 жыл бұрын
Nope, no difference.
@shraddhakshirsagar6958
@shraddhakshirsagar6958 9 жыл бұрын
Mus Magz ++bacon is preincrement and bacon++ is post increment. see the link stackoverflow.com/questions/4445706/post-increment-and-pre-increment-concept
@Legendofmudkip
@Legendofmudkip 9 жыл бұрын
+Tech Blog Box You are an awesome human being. That was the best explanation I've seen.
@a99023029
@a99023029 5 жыл бұрын
勉強になりました。Thanks
@TheXRealXBrapp
@TheXRealXBrapp 13 жыл бұрын
While(1==1){ bucky=awesome; } That's forever. Bucky will remain awesome indefinitely.
@crjacinro
@crjacinro 13 жыл бұрын
Hey MR. Bucky Roberts,, how many c++ tutorials have you made so far??? So far, i have seen 3 series tutorials on C++ : - Bucky's C++ Programming Tutorial (Code:Blocks, 2011) - C++ Tutorial (dev C++, 2008) - C++ Programming Tutorial (Code Blocks , 2010) so which of these tutorials am i gonna watch first as a beginner?? whats d diff between the 2010 and 2011 tutorial?? thanks..i just want to learn c++ .. NICe VIDs by the way...
@Boomerlance
@Boomerlance 12 жыл бұрын
Thats exactly how i think,and thus,i agree with you. I only go to college because in Panama,you need that goddamn paper in order to get a work with higher salary. you can obviously work on your own without doing a career,but your salary will be so damn low. I've learn more programming on my own than i would ever learn in that shit we know as... "college"
@__da1m__
@__da1m__ 9 жыл бұрын
hey bucky i noticed that if i write the code exactly the way you wrote it except for the while part which i wrote while (bacon = 0) the program does nothing. I guess it might have something to do with return 0; thing but care to explain
@dragonspeed99
@dragonspeed99 6 жыл бұрын
I need some help, I understand how to do this, but what am i making bacon equal to, isnt bacon apart of an integer that equals 0?
@nazliguleryuz4819
@nazliguleryuz4819 7 жыл бұрын
Hello I keep getting use of undeclared identifier 'cout' and use of undeclared identifier 'endl' why is that and i wrote exactly same code as you did.
@TWolfguarde
@TWolfguarde 11 жыл бұрын
That horrible moment after watching a bacon tutorial when you realise you have no bacon in your house. Or the neighbour's. At all.
@407mrREN
@407mrREN 11 ай бұрын
man, this guy really loves bacon.
@artistalreem1180
@artistalreem1180 6 жыл бұрын
Write a C++ programme that reads a sequence of integers terminated by zero value then finds the percentage of the negative numbers and the percentage of the positive number in the sequence. The programme output is as shown: : Enter a sequence of in integers terminated by zero 6 -7 -8 10 -12 14 15 2 -6 the percentage of negative numbers is 44.4 the percentage of positive numbers is 55.6 Please help me to solve this problem
@morxh8386
@morxh8386 9 жыл бұрын
BEST.TEACHER.EVERRRRRRRRRRRRRRRRRR
@nessriensayed9029
@nessriensayed9029 8 жыл бұрын
how could i make a calculator that you can enter any number of numbers you want by while loop and it stops when you press " = " i wrote ( char x ) and then made the condition in the while loop (char != " = " ) but it did't work and the was an error , and that was my last idea , witch failed
@taylorbeeston7367
@taylorbeeston7367 8 жыл бұрын
use single quotes instead of double quotes around '='
@Phoenix-ox2jr
@Phoenix-ox2jr 8 жыл бұрын
nessrien sayed youre trying to make it in a while loop, which can be a bit difficult. What you could do is use recursion. Recursion is when you make a function call itself so that it keeps going similar to a while loop. So you could write something similar to: void getNum(){ int i=0; vector number; string choice; cout > choice; if(choice=="yes"){ cout > number[i]; i++; addNum(); } //This will call itself after you use it until you answer anything other than "yes".
@Phoenix-ox2jr
@Phoenix-ox2jr 8 жыл бұрын
nessrien sayed actually if you really wanted to do it with a while loop you could have cin>> amountOfNums and then while(x
@mynameisSleepy
@mynameisSleepy 12 жыл бұрын
"those 100 peices of bacon were delicious can i have another?"
@vityabellic2983
@vityabellic2983 3 жыл бұрын
helped me so much brother
@emiliachan2021
@emiliachan2021 9 жыл бұрын
hmmm, how about while nested loop? where can i put the increment ?
@olivebates
@olivebates 13 жыл бұрын
I frowned when I told the program there wasnt any bacon.
@LinOchoa11690
@LinOchoa11690 12 жыл бұрын
i thought you were gonna say "once you understand the syntax of how a while loop works you can go ahead and make bacon"
@cabreram.4734
@cabreram.4734 5 жыл бұрын
But what if I wanted to print only the value of bacon all those times but not changing the value of the increment while printed out. Only print it 20 or whatever times?!
@nathansuarez5543
@nathansuarez5543 5 жыл бұрын
Use 2 variable. 1 for increment 1 for bacon
@collinsowusu-agyemang7688
@collinsowusu-agyemang7688 11 жыл бұрын
hi bucky, u the most outstanding tutor of all time !!! I'm "green" whn it comes to programming but your videos are getting me onboard now. Do u by chance have a video tutorial for Xcode for beginner like me?
@weexism
@weexism 10 жыл бұрын
Is there a way to capture the number of times the loop iterates?
@montecarlomoney5689
@montecarlomoney5689 12 жыл бұрын
You need to start Bucky School of Computing
@kingarthur0407
@kingarthur0407 13 жыл бұрын
i made an "OVER 9000!" counter. when it gets to 9001, it says " IT'S OVER NEIN THAUZAAAAAAHNNNDDDHHHH" lol.
@enanaalr3117
@enanaalr3117 8 жыл бұрын
i am trying to make a simple calculator allow to the user to enter how many number her/she wants. it goes well from the out side but when it start the calculation it gives a wrong result to the numbers i used these cods if you can help me please to know where is the mistake #include "stdafx.h" #include #include using namespace std; int main() { char operator_symbol, decision; float loopcount = 0, howmanynumbers, number, total = 0; decision = 'y'; while (decision == 'y') { cout > howmanynumbers; while (loopcount < howmanynumbers) { cout number; cout > operator_symbol; loopcount = loopcount + 1; } switch (operator_symbol) { case '+':total = total+ number; break; case '-':total = total- number; break; case '*':total = total* number; break; case '/':total = total/ number; break; default:cout
@jenaboabu1946
@jenaboabu1946 8 жыл бұрын
how do we program this series 7, 9, 14, 20, 27, 33, 42, 52, 63, 73, 86, ...
@REALCOOLLIKEVIPUL
@REALCOOLLIKEVIPUL 12 жыл бұрын
You can also write bacon++ instead of bacon = bacon+1 :-)
@videogameaddict68
@videogameaddict68 9 жыл бұрын
What's better for the while loop here? bacon = bacon + 1....... or bacon++?
@mikeduels
@mikeduels 13 жыл бұрын
So i did the while loop thing, still tryng to figure out how to make it stop :(
@siddhartharora5782
@siddhartharora5782 10 жыл бұрын
How is it different from the for loop?? for (int bacon=0; bacon
@forevatrolling
@forevatrolling 12 жыл бұрын
well BASIC has had a lot of history as a language taught as a first language because its simple and you can learn quite a few of the concepts required for more advanced programming, also ppl want to jump straight into GUI programming this is why lots of the good apps we see today are written in vb i doubt visual basic was ever taken as a 'serious programming language' by GOOD programmers. so to summarise schools are trying to adapt to fit the demands of todays market(shit idea if u ask me).
@joelsanchez3250
@joelsanchez3250 6 жыл бұрын
Bucky is fantastic !!!!
@2marshtomp
@2marshtomp 12 жыл бұрын
Umm Bucky I have a problem wih the program. Every time I want to make a new "program" I need to make a new project and start all over. If I just delete the lines I made and write the new ones it sais "Project *path to file here* cannot be saved..." and when I run it, it runs the old program. How do I fix that?
@Tanskinny
@Tanskinny 13 жыл бұрын
@Raneman25 They do the same thing, but his way uses more code, hence why I said "more efficient".
@hankmoody5514
@hankmoody5514 7 жыл бұрын
This guys teachs better than my bullshit bachelor's degree program. jesus christ...paying a bunch of money for a piece of paper
@singh123416
@singh123416 8 жыл бұрын
can you add a negative number ? just wondering
Buckys C++ Programming Tutorials - 19 - Simple Program Using a Loop
7:44
C++ Tutorial -   Loops In C++ [For Loop, While Loop, Do While Loop]
16:20
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 575 М.
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 984 М.
Loops in C++ (for loops, while loops)
12:20
The Cherno
Рет қаралды 422 М.
C++ while loops (#11) 🔄
10:43
Bro Code
Рет қаралды 12 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 339 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 314 М.
you will never ask about pointers again after watching this video
8:03
The 'while' Statement in C++
15:18
Neso Academy
Рет қаралды 116 М.
Learn C++ With Me #11 - While, Do While Loops & Break/Continue
24:01
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 138 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19