'Best in the world'...really?? I think u haven't checked other programmers cum teachers on CZcams. He is good, but 'best' signifies Hyperbole ( Atishyokti alankar).
@@entertainingshorts24 But he is literally one of the best if you want the explanation to be short, sweet and entertaining as well. I literally watched 30+ videos of his in a single day and still not bored while if I try to watch some other youtuber explaining it I would probably sleep through 1st tutorial itself.
@@entertainingshorts24 Again as I said I want short and sweet explanation to grasp the topic really quickly and once I understood it then I can dive deep to complex programs. For learning basics fast this channel is like a diamond. I've watched tutorials of Codewithharry, but I always stop watching the video after 1 or 2 tutorials. But in this channel, I've never stopped watching it continuously.
Thank you a million times, I watched like 100 videos for this. I even watched your videos like 10 times but didn't understand because I already belived that it's so hard. And now understand everything from 6:30 to 7:30? Thanks a lot, my home work and project was due to 3 days later. didn't know it's easy.
This guy really knows what he's teaching...Two topics in C++ that I found difficult to understand(Multidimensional array and this right here- passing arrays into Functions), he really demystified it all...Even in an easy to understand manner...10x bro...
as an options, you can use a vector for this sort of thing, so you won't need to use second variable "sizeofarray". but probably it is more advanced lvl.
You know, I've been messing around with arrays and I discovered that you can create an even cooler RNG program using arrays. All you have to do is create a for loop where the value of each element in the array is assigned to a seeded random number. Here's an example: #include #include #include using namespace std;void romba(int Input[], int Size);int main() { cout > y; int fofo[y]; srand(time(0)); for(int x = 0; x < y; x++){ fofo[x]= rand()%y; } romba(fofo, y); return 0; }void romba(int Array[], int Size){for(int x = 0; x < Size; x++){ cout
FYI (not sure if anyone else has mentioned this yet) if you don't want to worry about the array sizes or don't know the array sizes, look into using vectors.
when calling the function, do you put the position of a value in the array in the square brackets when you want to pass the position instead of the whole array ?.
I have one question. When I define the function printArray before main function, I don't really need to prototype printArray (i.e. Declaration). The program run fine and I got no error or warning messages. How does that even work? Thx!
computer programs read the code from top to bottom, the reason why you need to prototype a function is because the function is defined after the main function, so the computer would have no idea what the function is since it hasn't read the function yet, that's why you need to prototype the function to let it know beforehand that this function will be defined later after the main function. if you define the function before the main function then there's no need to prototype it because the function has already been read before the main function.
Actually, the reason you don't pass bucky with square brackets is because it is a pointer to the first element of the array. You cannot pass the whole block of an array as an argument (mainly because it's very slow to copy the entire array), so you just pass the address of the first element.
hi, i want to implement an application that reads a file, modify its content and write the modification back to the same file? how i can do that? would u please give me some hint?
yes you have to tell the computer that the elements in the array are integers, it makes sence too since array is nothing but a variable that can have different values at different time depending on the input, we treat x[ ] the same way we treat x
Got the code to compile OK however, my version of the program won't work without the system("pause"); and return 0; within main(). The program flicks the results on screen so quickly you can't see the results without the two functions above does anyone have any answers?
Hello Sir, Array can be overloaded or not,that means if we take two array with same name but different number of parameter,and we pass it through function call then it was not working.
I know this is an old video but how would I create a function that takes a single-dimensional array, modifies it (for example, adds 1 to each element), and returns the modified array? It doesn't seem to be as easy as i would have thought.
i'm pretty sure you would just add 1 to each element by going through it in the for loop, like myArray[n] = myArray[n] + 1, then print that element using myArray[n] or something
use sizeof(nameOfArray) to determine the size of an array. This gives you the size in bytes so just divide it by the size of each element in your array, e.g int, float, long = 4 and double = 8. I'll throw in an example: int myArraySize = sizeof(myArray)/4;
Ok when I do it they change my array values to extreme values I changed the array from double to integer and still with the changing values What do you think is up with that
Why parameters in the void function are separated by a comma and not by a semicolon? I though parameters are as statements and need to be separated each by a semicolon as in case of a for loop. I Am now confused as when to use comma and when semicolon when separating parameters of different functions!!!
what about sir printing the element of the array with numbers greater than 10 and reversing it like for example arr[2]={4321,2423,5356} each element should be reverse sample output: 1234 3242 6535
Why do we need the parameter int sizeOfArray in the void function, and is the loop function "really" doing any calculation(i.e. the increment statement x++)? Because when we run the code it just print out the elements of the array as they are.
No it isnt doing any calculations, all the loop does is print out the contents of that specific element. The reason you need the sizeOfArray parameter is so that your loop can know how many times to run but also to make sure you don't go out of bounds. (which is when you try to loop an index which does not exist. Possible reason for a crash.) Hope i helped, Happy coding :)
So, I have typed everything exactly as he has but for whatever reason nothing comes up when I build and run it. It did the same thing for the previous video.
He says loads of times that "How am i going to explain this " and ends up explaining it the best in the world.
'Best in the world'...really??
I think u haven't checked other programmers cum teachers on CZcams.
He is good, but 'best' signifies Hyperbole ( Atishyokti alankar).
@@entertainingshorts24 But he is literally one of the best if you want the explanation to be short, sweet and entertaining as well. I literally watched 30+ videos of his in a single day and still not bored while if I try to watch some other youtuber explaining it I would probably sleep through 1st tutorial itself.
@@omkarjsuvarna may be...but if u are a hindi speaker then u can also follow Codewithharry.
@@entertainingshorts24 Again as I said I want short and sweet explanation to grasp the topic really quickly and once I understood it then I can dive deep to complex programs. For learning basics fast this channel is like a diamond. I've watched tutorials of Codewithharry, but I always stop watching the video after 1 or 2 tutorials. But in this channel, I've never stopped watching it continuously.
@@entertainingshorts24 shush kid
Prof: gimme some name for the array
Me: bucky
prof: gimme some name of the array you boy
me: Aditi joshi
class: hahahahahhhaa
prof: get the fuck outta here
@Shallex little virgin let him laugh
Sheez 🤦🏻♂️ these virgins are so cringy
For real for real
Crazy how this tutorial is still as informative 13 years later. Preciate the good work 👏
I have watched 20 or so and some a couple of times just to get it through my head. Great stuff!!!!!
Thank you a million times, I watched like 100 videos for this. I even watched your videos like 10 times but didn't understand because I already belived that it's so hard. And now understand everything from 6:30 to 7:30? Thanks a lot, my home work and project was due to 3 days later. didn't know it's easy.
Bucky, one of the best teacher for programming !
This guy really knows what he's teaching...Two topics in C++ that I found difficult to understand(Multidimensional array and this right here- passing arrays into Functions), he really demystified it all...Even in an easy to understand manner...10x bro...
Excellent class..had no problems understanding whatsoever..u r a lifesaver!!
8 mins of Bucky's tutorials VS 2 whole lectures
These quick videos teach me so much better & faster than my professor and the “teaching” program he makes me buy which mind you is expensive !
This video helped me a bunch on my homework. Thank you!
Wow. I was super stressed. I couldn't understand no matter how many tutorials I watched. Now I do Alhamdolilah. Thank you so much.
He explains everything so much that during 5: 03 he was out of explanations .. Legend
Great tutorial cleared up the basics
thanks man. I wracked my brain about how to put an array into a function. Now my programm is running. I appreciate your help.
literally saving my semester 😭👌🏼
which semester brother i mean in which semester it was asked
It annoys me that he keeps asking "What is going on guys?" but doesn't give us time to answer.
hahhaa nice one bro !
hhhhhhhhhhhhhhhhhhhhh same thing XD
xDDDDDDDDDDDDD
when you realize you have no social life
u can just pause and answer it to urself
this really confused me for a bit but thanks to you i get it now c:
as an options, you can use a vector for this sort of thing, so you won't need to use second variable "sizeofarray".
but probably it is more advanced lvl.
You have been helping me so much ! Thank you so much !
I love how you teach.
great work sir !!
hats off to you
You know, I've been messing around with arrays and I discovered that you can create an even cooler RNG program using arrays.
All you have to do is create a for loop where the value of each element in the array is assigned to a seeded random number.
Here's an example:
#include
#include
#include using namespace std;void romba(int Input[], int Size);int main()
{
cout > y; int fofo[y];
srand(time(0)); for(int x = 0; x < y; x++){ fofo[x]= rand()%y;
} romba(fofo, y); return 0;
}void romba(int Array[], int Size){for(int x = 0; x < Size; x++){ cout
great : i a'm confused how to use array but now i'm happay after your tutorial.
Thanks for making these. :)
FYI (not sure if anyone else has mentioned this yet) if you don't want to worry about the array sizes or don't know the array sizes, look into using vectors.
Thank you very much...exactly what i expected
one of the best explain 👍
amazing bro....... thank u soo much.... u have made this very easy to understand...... ty bro
We went from 360p to 4K in 7 years! Amazing!
8K*
woww thanks you really helped me a lot, l got a final tomorrow 🔥🔥🔥🔥
i listen to this in 1.5 speed, its actually pretty efficient
damn
very good and clear explanation thank you very much
For someone who's never said WOW in their life you certainly said it a lot in your post.
This is so useful. Thank you
Thanks ..and be blessed🙏
thanks bukky ur tutorials are helpful
Got it!
thanks again,dude :)
Yes lol, I know, I gave you the link to this video! :D, glad it helped! Goodluck on your coding!
when calling the function, do you put the position of a value in the array in the square brackets when you want to pass the position instead of the whole array ?.
You are a lifesaver
bucky,you still the best
OMG you saved me! very useful!
Video almost a decade ago helped me today..😘😘
in the loop where it says thearray[x] [x] signifies the int right? since it is a int variable?
I wish there were some manner tutorials for guys like you.
I'm using G++ as a compiler and it works even without the prototype.
Do you have to put the number of elements in the square brackets or can you just leave them empty?
how do we add two different arrays of same length and store the result in any other array
I have one question. When I define the function printArray before main function, I don't really need to prototype printArray (i.e. Declaration). The program run fine and I got no error or warning messages. How does that even work? Thx!
computer programs read the code from top to bottom, the reason why you need to prototype a function is because the function is defined after the main function, so the computer would have no idea what the function is since it hasn't read the function yet, that's why you need to prototype the function to let it know beforehand that this function will be defined later after the main function. if you define the function before the main function then there's no need to prototype it because the function has already been read before the main function.
Im looking for a function to take an array redim its size and fill it.
then print its information from the main
Please help!!
The autocompletion doesn't work on CodeBlocks for me (knowing that I have everything checked).
How to overcome that?
haha;; I like how you say overcome. You already figured it out I believe
Actually, the reason you don't pass bucky with square brackets is because it is a pointer to the first element of the array.
You cannot pass the whole block of an array as an argument (mainly because it's very slow to copy the entire array), so you just pass the address of the first element.
can we just build the function before the MAIN, so there's no need to add another prototype???
I'm not quite sure what you're asking, but that statement is fine, provided the variables all have a value.
Little tip for you guys: you can get the length of an array by using this:
int length = sizeof(array) / sizeof(/*arraytype eg.:*/ integer)
hi, i want to implement an application that reads a file, modify its content and write the modification back to the same file? how i can do that? would u please give me some hint?
what if we had a integer which named as bucky how it is going tounderstand we are talkng about bucky which is array? could you help me
yes you have to tell the computer that the elements in the array are integers, it makes sence too since array is nothing but a variable that can have different values at different time depending on the input, we treat x[ ]
the same way we treat x
Hello Bucky, I hope you still read these comments.Can you do a video on how to use Code::block????? I can't get it to run or compile??thanks.
thank you !! you are the best :))))
If there is an other array for input also so what to do
CZcamsr guides > Your uni lecturer
When I run jessica with a size greater than the functions size, it starts showing bucky's integers, but the reverse does not happen. What causes this?
Got the code to compile OK however, my version of the program won't work without the system("pause"); and return 0; within main(). The program flicks the results on screen so quickly you can't see the results without the two functions above does anyone have any answers?
good. One should also pass the size of array as argument in 1D array. How the function will know the size of the 2D array?
I don't understand, the variable x is not declared in the program but there is no error?????
Hello Sir, Array can be overloaded or not,that means if we take two array with same name but different number of parameter,and we pass it through function call then it was not working.
@thenewboston can u make a video on how to use array for sentinel loop? i really hope u can help me
I know this is an old video but how would I create a function that takes a single-dimensional array, modifies it (for example, adds 1 to each element), and returns the modified array? It doesn't seem to be as easy as i would have thought.
i'm pretty sure you would just add 1 to each element by going through it in the for loop, like myArray[n] = myArray[n] + 1, then print that element using myArray[n] or something
bad ass bucky, thx
Really helpful
why i can't use printarray(bucky[3], 3)
or printarray(bucky[],3)
what kind of a program he's using? doesn't look like visual studio to me, can anyone tell me please ?
how do i get the length of an array declared elsewhere?
if you put the main function under the void function, you won't get an error message and will work just fine.
use sizeof(nameOfArray) to determine the size of an array. This gives you the size in bytes so just divide it by the size of each element in your array, e.g int, float, long = 4 and double = 8.
I'll throw in an example:
int myArraySize = sizeof(myArray)/4;
Ok when I do it they change my array values to extreme values
I changed the array from double to integer and still with the changing values
What do you think is up with that
how to find length of array when only array is passed into the function ?
His folder name is Watermelon........hahahahah
my folder name is tits......hahahaha
FUCK
very nice. thanks
Why parameters in the void function are separated by a comma and not by a semicolon? I though parameters are as statements and need to be separated each by a semicolon as in case of a for loop. I Am now confused as when to use comma and when semicolon when separating parameters of different functions!!!
I'm pretty sure you can include the body of your function with your prototype, anyone know if there is a reason you shouldn't do this?
First time I've seen my name as a variable - woo! :)
in function prototype that u used cant we write void printArray(int[],int); ???
Same doubt
Thanks Bro T T You even care about us more than our teachers do!! (Watch out,Don't forget. You're pro with this) Like seriously Thanks bro!
what about sir printing the element of the array with numbers greater than 10 and reversing it like for example arr[2]={4321,2423,5356} each element should be reverse sample output: 1234 3242 6535
Why do we need the parameter int sizeOfArray in the void function, and is the loop function "really" doing any calculation(i.e. the increment statement x++)? Because when we run the code it just print out the elements of the array as they are.
I believe you need that so you can check if x is less than sizeofArray
No it isnt doing any calculations, all the loop does is print out the contents of that specific element. The reason you need the sizeOfArray parameter is so that your loop can know how many times to run but also to make sure you don't go out of bounds. (which is when you try to loop an index which does not exist. Possible reason for a crash.) Hope i helped, Happy coding :)
Bucky, How do you make return an array in a fucntion?
bucky jani tu love ha
Nice video
which compiler is the best
what if any number user input not 3/6 /etc ..
So, I have typed everything exactly as he has but for whatever reason nothing comes up when I build and run it. It did the same thing for the previous video.
Do you still need to add the 'Int' on the real function not the prototype?
:O
*Jaw Dropped*
The holy oPryze has learned from Master Bucky!
how does the compiler know "sizeOfArray" is the size of the array tho
What if you had an int named the same thing as the array, how would it know to pick the array and not the int?
can we run both the arrays at the same time?