Understanding Arrays in C Programming | Edureka
Вставка
- Опубліковано 29 вер 2024
- Watch sample class recording:
www.edureka.co/...
An array in C Programing Language can be defined as number of memory locations, each of which can store the same data type and which can be references through the same variable name.
Topics covered in the video:
1.What is an Array
2.Initialization of Arrays
3.Example Program in C
Edureka is a New Age e-learning platform that provides Instructor-Led Live, Online classes for learners who would prefer a hassle free and self paced learning environment, accessible from any part of the world.
The topics related to ‘Understanding Arrays in C Programming’ have been extensively covered in our ‘C & Data Structures' course.
For more information, please write back to us at sales@edureka.co
Call us at US: 1800 275 9730 (toll free) or India: +91-8880862004
Thank You! This was very helpful and it was very easy to understand.
Hey, thanks for the wonderful feedback! We are glad we could help. Do subscribe to our channel to stay posted on upcoming tutorials.
Thank you very much for vıdeo!
Great tutorıal
+Muhammadjon Tursunov We are glad you liked it. You must also check out our blogs sometime @ edureka.co/blog/
wao, such a great explanation, very helpful video sir, thank you 👍👍
Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)
do you have java video lectures
Hey Suraj, thanks for checking out the tutorial! Here's the link to the Java tutorial playlist: ua-cam.com/play/PL9ooVrP1hQOFR25JoQW3h3n5pBs77e6KU.html. Cheers! :)
You're amazing!
Thanks a ton for your help. BTW in the word "array" the emphasis is on the second syllable, "uh RAY."
Hey Natham thank you for watching our video. We will definitely keep this in mind :)
Well explained...I have already subscribed your channel for more such a helpful videos.
Thank you for subscribing to us Simran. Stay tuned for updates on our channel. Cheers :)
It helps a lot to me..... Thank U So Much..... 😊😉
Hey Preksha! We are delighted to know that you liked our videos. Subscribe, like and share to stay connected with us. Thanks :)
can we just use int a[ ] instead of int arr[ ] in the subprogram of largest number ?
+Mighanut mya, thanks for checking out our tutorial!
Yes, you can use any other name, and even your name. The only limitation is that the name should not be a keyword(reserve language word) and few other. But there are some rules that are followed while naming variable and the most important one is that the names should be intuitive.But there are a lot of variabe naming conventions that people follow, you can even create your own naming convention. Compiler stores these variable names in symbol table and this symbol table is used during run time for name to memory mapping. The compiler may even discard name provided by you totally and use it's own name internally in symbol table. That is how function overloading works in C++. So, a or arr is all for your ease. Use what suits you better. Here arr gives you a hint that arr variable by name looks like an array.
Hope this helps. Cheers!
This helped me a lot.Thank you!
Hey Abhishek, thanks for checking out the tutorial! We're glad you liked it. Here's the entire playlist: ua-cam.com/play/PL9ooVrP1hQOFrNo8jK9Yb2g2eMHz7hTu9.html. We thought you may find it useful. Cheers!
Helpful great job .. 👍👍
Nice explanation thank you
thankss
int take 2byte memory. not 4byte¿¿¿
Hey Sameer, thanks for checking out our tutorial! The size of an int is really compiler dependent. Back in the day, when processors were 16 bit, an int was 2 bytes. Nowadays, it's most often 4 bytes on a 32 bits system or 8 bytes on 64 bits system. Still, using sizeof(int) is the best way to get the size of an integer for the specific system the program is executed on. Hope this helps. Cheers!
Thanks
Watching after 7 years after uploading and this is still incredible ❤️
Thank you ❤️
We are very glad to hear that your a learning well with our contents :) continue to learn with us and don't forget to subscribe our channel so that you don't miss any updates !
Nice video i learnt perfectly through edureka
AND NICE TUTORIALS.
Thanks for the feedback! :) Do follow our channel to stay posted on upcoming tutorials. You can also check out www.edureka.co/blog/ for relevant reading material. Cheers!
Nice explaination
Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)
That is beautiful!!
Hey Curious Bit, thank you for watching our video. We are glad to know that you liked our tutorial. Do subscribe and stay connected with us. Cheers :)
Thank you, this helped me very much!
Glad you liked it! Do keep checking back in for more videos. You must also check out our blog page sometime @ Edureka.co/blog/
Hi, I'm unsure as to why when you pass the array through the function you don't need to initialise the variable num? Where does num get its value from?
Hi, thanks for checking out our tutorial.
When passing an array to a function, we just pass the array name. Array name points to the base address of the array. The function gets the value of the array from that base address.
Hope this helps. Cheers!
12:42 how can accessing a value in memory out of range of array size corrupt a memory ?
Hey Sharad, thanks for checking out the tutorial! With regard to your query, please go through the below given example:
int i;
int arr[3];
int main(void)
{
for(i=0;i
niceee vide0
Hey Shahana, thanks for checking out the tutorial! We're glad you liked it. Here's another video we thought you might find useful: ua-cam.com/video/AOI_ZoRi8vM/v-deo.html. Cheers!
Great tutorial+love the fact that you reply to every comments.Also i wad wondering why num's been used here and what exactly is the value of num and to what maximum point does this loop go upto
Hey Suman! Yes, we try to remain connected with our viewers. Thank you for acknowledging it. To answer your query: 'num' is used to set a limit to your loop. Over here, your loop is limited to 10 iterations so, the value of num is 10. The lop has a maximum of 10 iterations.
Hope you find this useful as well. Cheers :)
why u write system("pause"); please explain clearly
Hey Bharat, thanks for checking out the tutorial! About your query, system("PAUSE") is used to stop the terminal from exiting quickly before you can see the results. If you use system("PAUSE"), the console window stays open so that you can read the output. Hope this helps.
why have you intialized a[10]=0
Hey Suraj, thanks for checking out the tutorial! The statement
a[10] = {0} ;
at the beginning of the main() initializes all the elements of array a to 0 so that none of the entries contain garbage values. Hope this answers your query. Cheers!
what is system("PAUSE") and what does it do?
+KaiochanX3, thanks for checking out our tutorial!
System("pause") runs the Windows command-line "pause" program and waits for that to terminate before it continues execution of the program - the console window stays open so you can read the output.
Hope this helps. Cheers!
+edureka! Oh right, thanks for the information, great video
hello sir, i am not able to understand that, the variable b is of int type then why it will take 4 bytes as you explained above.
Hey, thanks for checking out the tutorial! With regar to your query, the variable b is of type int, but it is an array so the size of the array will be (size of int) * (size of the array)= (4*5)=20 bytes. Hope this helps.
GOT IT. THANKYOU
for 16-bit compiler needs 2 bytes memory and for 32-bit compiler int need 4 bytes memory.
16-bit compiler ==>> Turbo C
32-bit Compiler ==>> GCC or Visual Studio
is this what you were asking (why 4 bytes and why not 2 bytes) ?
Thankyou .
Hey Sharad, thanks for checking out the tutorial! With regard to your query, it depends on the platform. It is implementation-defined. It can be 2, 4 or something else. It can be 2 bytes then there doesn't comes the use of 32-bit to increase the size of int it is upgraded to 32-bit. Could you please elaborate on your query to help us support you better? Cheers!
This was really helpful man! I understand how to work with arrays now!