Bella Rose It should be "I cat speel!" I don't understand why it's even thenewboston. Shouldn't it just be Bucky. That's what he always calls himself and I've never heard him mention thenewboston.
this is honestly so amazing... I've had this tutorial saved in my playlist for so long cause i didnt have time to learn c++ and now i wish i had been because these are just basically simple steps that makes c++ programming so easy
RfTbKaBoosh made a good point. Another point is that you shouldn't always want the same numbers as every element of an array. For example as a bit of extra practice I made an array with 100 elements and a for loop that filled each element with a random number, 1-6. So it's basically a program that rolls a die 100 times and prints out the results. In that example, although it's possible to do without the array, the point of it was to practice with arrays so that's why I used one.
For people watching this years later. This is OLD C++. Because people nowdays don't use this kind of array. They use *std::array bucky;* instead of: *int bucky[9];*
@kraeukai the use of this is for example if you replace the bucky[x]=99 with user input cin>>bucky[x] or with some value you use . Depends in which program. This is just basic way to fill a array faster than typing all the elements!
@cssadiction don't lose your motivation man.. If you don't understand something just keep practicing over and over and you'll get it... Programming learning curve is very hard to get over but once you are past the learning curve it gets easy.
@cssadiction You just dont want to declare the variables inside the loop body, otherwise everytime the loop repeats, it would redeclare the integer again each time, which is kinda bad. For the while loop you should do this: int sumNum = 50; int x = 0; while (x < 5) {sumNum -= 10; x++;} and not this: int x = 0; while (x < 5) {int sumNum = 50; sumNum -= 10; x++;}
Hey thank you so much for this tutorial but right now am having a college assignment on creating a menu system and we are supposed to use arrays, functions and loops.... could you please help me out with this... i really need help
@cssadiction 'x' didnt replace bucky, it just changed the index. as x went from 0 to 1 to 2 to 3 to 4..... bucky took that in like bucky[0] bucky[1] bucky[2].....
I was kinda hoping that I would find a video on youtube dealing with while loops and do-while loops, with Arrays being tested. I'm attempting to use one to validate user input to be greater than 0 while they are inputing into the subscripts of the array.
Isn't it a little confusing to make an int x, and then an array value like bucky [x]? I don't know if programmers do this in c++ but when I was studying visual basic the book would make all counters like int count1, int count2, etc.
I modified your program so the user can enter how many numbers he wants to store in that array and can enter them, and later on an element table is made. #include #include #include using namespace std; int main() { int i, howMany; cout howMany; int numbers[howMany]; for(i=0; i
Is there anything wrong with this code? What I'm trying to do to show five different examples of how arrays (based on tutorials 32 to 36) while having the user choose which example they want. Problem is when I run it, the first example shows nothing while the second example shows gibberish. I have coded two examples thus far. #include #include using namespace std; /* Arrays are variables that can hold more than one value. When calling a value from an array the computer starts from 0, so if an array had 3 values to call the third value input 2 instead. i.e. 0, 1, 2 represents the first second and third values respectively. int 'Array name'[number of values] = {values separated by commas} */ /* It is also possible to create Arrays using loops. One way this can be done is by: creating the array first without putting the values in, then create a loop so that an integer x is increasing, then input x into the array to create the values */ int main() { int example; cout example; switch (example) { case 1: int visual[3] = {9000, 900, 99}; cout
+Heds123 Hey man, I tried running this code on my code, and it looks fine, except it gave this error starting with 'Crossed Initialization' And this was the proper answer I got " A "case" of a switch doesn't create a scope, so, as the error says, you're jumping over the initialization of "sum" if the choice isn't 1. You either need to declare sum and diff outside the switch, or create blocks with { } for each of the cases." What this means is that you need change your case code to what I typed belowcase 1:{
At the moment it seems that arrays can only be statically initialized. I wonder if there is a later tutorial on dynamic initialization of an array. From a memory allocation perspective one thinks not; because it seems in C++ the size of memory is allocated at the point of compilation. But the other half of me thinks there must be a way to store things dynamically where the quantity is unkown at that time; maybe the programmer just puts away a ridiculously large amount of memory in prudence.
hello. thank you so much for these videos, you explain them better than my professor does. I wanted to ask you, what program are you using as the compiler?
Does c++ support 'lists', where you don't have to specify its size and can update it as needed. If not, can this be achieved in some other way? Creating a new array for each new element you add seems kind of cumbersome.
First, use std::vector instead of arrays for this, the push_back() functionality of vectors is an advantage for this operation. Second, there's no single way to go about that, and every way I could name is situation. If you're only storing single words in an array, then simply running it through a for loop will accomplish what you need. If not, then you need separators, and you need to learn how to use sstream + substr. Good luck, you could google the answer, but finding it on your own is fun.
Eyy, Bro I'd like the way on how you showed up the idea using array with loop.. But somehow, I've find your c++ programming a little different, if i may ask, what kind of c++ program you used in your video??
But wouldn't it need to be adapted, as it relied on time to generate numbers before, and our for loops run in much less time than a second, you would get the same random number each time.
You can create different array of same length but with elements and u can assign it like int arr[9]; int arr2[9] ={1,2,3,4,5,6,7,8,9}; Then on line no 11 of code in video i can assign instead of bucky[x] = 99 You can add arr[x] = arr2[x] Then the output will be 0 ------- 1 1 ------- 2 2 ------- 3 . . .
hi sis, I'm Salwa from Indonesia. before I want to ask permission, because I want to record your screen video. Very useful for my informatics assignment thank you Sis
At place? if you want to put 'a' to place 4 in an array and you are printing characters (rather than integers), then you would create a char array: char arr[9]; and set arr[3] = 'a';
+kokorolex You have to specify a character to form the letter, and then use nested loops and manipulate the output a LOT (and I mean like really a lot). Include library to edit the spaces and breaks between the lines to get the shape of your letter.
I was wondering the same thing. Like how could you store large amounts of random numbers using a for loop? To me, it looks like the only way to make the numbers in the array vary is if you set "bucky[x]" equal a function of x in the loop. Therefore the numbers wouldn't be independant :/
"Pretty cool huh?" should be the channel name
Bella Rose It should be "I cat speel!"
I don't understand why it's even thenewboston. Shouldn't it just be Bucky. That's what he always calls himself and I've never heard him mention thenewboston.
+Bella Rose LMAO!!!!
It should be "i don't just walk the walk talk the talk"
😂 😂
@@anchalpandey2787 let me go ahead ha
more than 7 years later, this dude on youtube is still teaching people better than a $2,000 university class can.
I am in a college c++ class and understand more from these videos than my own teacher o.o.
Tell your professor to step his game the eff up. this is review for me lol.
same
Hey :) I passed my college course in c++ with a C ^.^ thanks to your videos. I'm now in java lol wish me luck.
thamuz01 All the best.... pass JAva with an A+
+Marshall Mathers More like A++
+thamuz01 Are you like, mocking him? xD
do you still remember what grade you passed Java with?
can't imagine how i understand so fast from watching your tutorials. Bucky u are so cool...
I love this video - it's clear, short and easy to understand. Thank you so much for posting.
this is honestly so amazing... I've had this tutorial saved in my playlist for so long cause i didnt have time to learn c++ and now i wish i had been because these are just basically simple steps that makes c++ programming so easy
And the compiler says "Yes, Sir!"
"Array" master
yessir
"Check this out... Pretty cool uh?"
"Get your fingers out ..." LOL
"Pretty cool, huh?". Love it.
Pretty cool how element and value are set on the same line with their respected rows. I can really use that for my database project, thanks Buck.
Why did a programmer quit his job?
Because he din't get arrays
+lilboss2013 haha I laughed way more than I needed to.
you are a lifesaver i wish there is a teacher like you in our collage.
Bucky is amazing! it can't get any clearer. Thank you
much better explanation than any online class. thanks bucky
thanks sir you are awesome teacher
you teach in depth
detail
The reason that it prints out vertically like that is because he add "endl" after each entry. This creates a new line after each entry.
RfTbKaBoosh made a good point. Another point is that you shouldn't always want the same numbers as every element of an array. For example as a bit of extra practice I made an array with 100 elements and a for loop that filled each element with a random number, 1-6. So it's basically a program that rolls a die 100 times and prints out the results. In that example, although it's possible to do without the array, the point of it was to practice with arrays so that's why I used one.
Why do i need to go college when iv'e got your videos.
Great job!
He makes things so easy to understand
legit bro i love you for this tutorials, im learning more than in 3 years of university and im allways laughing my ass of xd
Dude Bucky is approaching god-tier in teaching c++ lol
For people watching this years later. This is OLD C++. Because people nowdays don't use this kind of array. They use *std::array bucky;* instead of: *int bucky[9];*
@kraeukai
the use of this is for example if you replace the bucky[x]=99 with user input cin>>bucky[x] or with some value you use . Depends in which program. This is just basic way to fill a array faster than typing all the elements!
This is a Great series of C++ Tutorials
Great tutorial, It gave me a way better understanding on Arrays :)
Thank you!
Thank you, u r the best teacher of array!
"I will see you in the next door ", Wow
Pretty cool method of explanation, Thanks Man!
"count with me, get your fingers out" BUCKY IS SUPER COOL!
Thanks for all your help Bucky!
Hey Bucky you know your stuff and i respect that
@cssadiction don't lose your motivation man.. If you don't understand something just keep practicing over and over and you'll get it... Programming learning curve is very hard to get over but once you are past the learning curve it gets easy.
YES SIR gachiGASM
bucky: compiler, store memory for 8 values.
compiler: yes sir.
@cssadiction You just dont want to declare the variables inside the loop body, otherwise everytime the loop repeats, it would redeclare the integer again each time, which is kinda bad. For the while loop you should do this: int sumNum = 50; int x = 0; while (x < 5) {sumNum -= 10; x++;} and not this: int x = 0; while (x < 5) {int sumNum = 50; sumNum -= 10; x++;}
" There are actually a lot of nines in this soil "
Pretty Cool huh?
"count with me, get your fingers out: 1,2,3,4......" i mean who doesn't love bucky 3>
you just insulted 99, you called it stupid! lol, until now your videos are helpful! thanks a bunch bucky!
You are life savior !! Thanks so much..
Hey thank you so much for this tutorial but right now am having a college assignment on creating a menu system and we are supposed to use arrays, functions and loops.... could you please help me out with this... i really need help
What if the values of elements are different? In that case should we write all the element values in curly brackets or is there any alternative?
+BHUVNESH BHUWAN
simply:
bucky[0] = 1212;
bucky[1] = 443;
and vice versa
Is there a way to use the array to determine the stopping point of the for loop? IE: for (int i = 0; i < Bucky.length(); i++) { bucky[i] =99;} ??
@cssadiction 'x' didnt replace bucky, it just changed the index. as x went from 0 to 1 to 2 to 3 to 4..... bucky took that in like bucky[0] bucky[1] bucky[2].....
I was kinda hoping that I would find a video on youtube dealing with while loops and do-while loops, with Arrays being tested. I'm attempting to use one to validate user input to be greater than 0 while they are inputing into the subscripts of the array.
His jokes makes the video enjoyable 😂
You can use the if statement
int x = 50;
int bucky[50];
for (int i = 0; i < 50; i++) {
if (i < 50) {
bucky[i] = i*i;
cout
What the fuck is this code. 1. Why is int x here? 2. It's always going to be less than 50 so why have an if statement for less than 50.
#include
using namespace std;
int main()
{
int forhad[11];
cout
you can use srand(time(NULL)); and bucky[x] = rand();
For mine it prints all zeros on the right hand side and says " index 99 is out of valid index range 0-8 for possibly stack allocated buffer??
@MrLowesc I know you posted this 4 months ago but I just had to say, thanks for the practice idea!
Isn't it a little confusing to make an int x, and then an array value like bucky [x]? I don't know if programmers do this in c++ but when I was studying visual basic the book would make all counters like int count1, int count2, etc.
Nice, only took me a few minutes to fix it up and get working.
sir what would we do ... if we want to give a differents value to a 8 elements of the array..??
I modified your program so the user can enter how many numbers he wants to store in that array and can enter them, and later on an element table is made.
#include
#include
#include
using namespace std;
int main()
{
int i, howMany;
cout howMany;
int numbers[howMany];
for(i=0; i
what are the cstdlib and ctime included for?
Not really a huge thing, but variables used in loops are usually in triples like: for(iii>0) or jjj and not just a single
***** That's only if you are using nested loops.
+Alex Zota I don't see why they are included either
Is there anything wrong with this code? What I'm trying to do to show five different examples of how arrays (based on tutorials 32 to 36) while having the user choose which example they want. Problem is when I run it, the first example shows nothing while the second example shows gibberish. I have coded two examples thus far.
#include
#include
using namespace std;
/*
Arrays are variables that can hold more than one value.
When calling a value from an array the computer starts from 0, so if an array had 3 values to call the third value input 2 instead.
i.e. 0, 1, 2 represents the first second and third values respectively.
int 'Array name'[number of values] = {values separated by commas}
*/
/*
It is also possible to create Arrays using loops.
One way this can be done is by:
creating the array first without putting the values in,
then create a loop so that an integer x is increasing,
then input x into the array to create the values
*/
int main()
{
int example;
cout example;
switch (example)
{
case 1:
int visual[3] = {9000, 900, 99};
cout
+Heds123 Hey man, I tried running this code on my code, and it looks fine, except it gave this error starting with 'Crossed Initialization'
And this was the proper answer I got
"
A "case" of a switch doesn't create a scope, so, as the error says,
you're jumping over the initialization of "sum" if the choice isn't 1.
You either need to declare sum and diff outside the switch, or create blocks with { } for each of the cases."
What this means is that you need change your case code to what I typed belowcase 1:{
At the moment it seems that arrays can only be statically initialized. I wonder if there is a later tutorial on dynamic initialization of an array.
From a memory allocation perspective one thinks not; because it seems in C++ the size of memory is allocated at the point of compilation. But the other half of me thinks there must be a way to store things dynamically where the quantity is unkown at that time; maybe the programmer just puts away a ridiculously large amount of memory in prudence.
Then sir. How can i insert some text/name in each number?
just like 1 will stands for ELLA
then 2 stands for John
and so on..
Thank u very much..
It's funny that I'm studying civil E and the university force me to study this
hello. thank you so much for these videos, you explain them better than my professor does. I wanted to ask you, what program are you using as the compiler?
+Neveen Barada Code Blocks
Does c++ support 'lists', where you don't have to specify its size and can update it as needed. If not, can this be achieved in some other way? Creating a new array for each new element you add seems kind of cumbersome.
+Peterolen Thanks! I'll look into it. =)
Dynamic Array(std::vector), StaticArray(aka this [] array, std::array)
how did you exactly managed the space?? see 99 comes exactly below the value.
i just love his these things : "check this out .... isn't this cool ....... what are you doing Bucky ........... ".i love these. 😂😆😜😋
can the arguments and return values of a function be arrays? like this : int[3] vektorAdd(int x[3], int y[3]){} ???
But what if we want different values for different indexes/elements? What if we don't want 99 for every index?
Hey, what compiler are you using?
I'm learning c++ with visual basic and it doesn't work very well.
so when you initialize "int bucky[9];" does that assign 0 to every array element or is it just null?
no, java does but not c++;
but what if all the array values are different?
what if I want the array to be different numbers and not just the same number repeating?
I want bucky [x] to have different values, say, all the even numbers till 20. How do i do that?
int x = 0; //set variable to control loop
int even20[100]; //create array that holds up to 100 elements
while(x
Jon Krugel thanxx buddy..!!
First, use std::vector instead of arrays for this, the push_back() functionality of vectors is an advantage for this operation.
Second, there's no single way to go about that, and every way I could name is situation. If you're only storing single words in an array, then simply running it through a for loop will accomplish what you need. If not, then you need separators, and you need to learn how to use sstream + substr.
Good luck, you could google the answer, but finding it on your own is fun.
loving ur tuts
kool. What desktop capture software do you use?
Eyy, Bro I'd like the way on how you showed up the idea using array with loop.. But somehow, I've find your c++ programming a little different, if i may ask, what kind of c++ program you used in your video??
amazing tutorials man !
use "cin" within for loop to input the values... and "cout" within another for loop to dispaly the values ....
what if i want to make the "value" part random numbers instead of 99 ?
asantelaalow
int main()
{
srand(time(0));
int tanmay[9];
for (int x=0; x
i em your student Fan sir Bucky you beauty
How were you able to create it to print out the array in a straigh downward row.
The "endl" was also being looped.
which program is this? i am asking because of the non-required "return 0" and some cool accessories
What if we want to store strings instead of int?
i'm very confused on how you use the for loop and array
I have one line printed each time. 5 of them aren't snowing together. Anyone tell why
i love you , your are very helpful
But wouldn't it need to be adapted, as it relied on time to generate numbers before, and our for loops run in much less time than a second, you would get the same random number each time.
cout
What if me want to give different value for each element? Please Answer ....
You can create different array of same length but with elements and u can assign it like
int arr[9];
int arr2[9] ={1,2,3,4,5,6,7,8,9};
Then on line no 11 of code in video i can assign
instead of bucky[x] = 99
You can add
arr[x] = arr2[x]
Then the output will be
0 ------- 1
1 ------- 2
2 ------- 3
.
.
.
Does using array and printing them out automatically have them printed vertically? like
0
1
2
3
?
Great tutorial, I
hi sis, I'm Salwa from Indonesia.
before I want to ask permission, because I want to record your screen video. Very useful for my informatics assignment
thank you Sis
Okay, so what's the point if every array element is the same value?
ur amazing keep up the good work
how would i do this if i was trying to use char 'a' is located at space 4?
At place? if you want to put 'a' to place 4 in an array and you are printing characters (rather than integers), then you would create a char array: char arr[9]; and set arr[3] = 'a';
thanks
Is this anything like ASSIGNMENT:
A7 - Student Line Up
TO ME, This was the most confusing yet. Only because I tried extra stuff though.
How do you make a giant letter using an 10 by 10 array? I'm so lost :[
+kokorolex You have to specify a character to form the letter, and then use nested loops and manipulate the output a LOT (and I mean like really a lot). Include library to edit the spaces and breaks between the lines to get the shape of your letter.
how to download all video at once?
i want to do the same with java .. may you help me please ?
But what is the point ?All those array elements are equal to 99....why would you want that ?
It's an example, is can be used to store big amounts of data like usernames and city names
I was wondering the same thing. Like how could you store large amounts of random numbers using a for loop? To me, it looks like the only way to make the numbers in the array vary is if you set "bucky[x]" equal a function of x in the loop. Therefore the numbers wouldn't be independant :/
He could've just had a cin>> int a;
v[x] = a; and set a new element every time
that's really pretty cool 😊