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

КОМЕНТАРІ • 58

  • @kevinnimanda2525
    @kevinnimanda2525 4 роки тому

    Thank You! This was very helpful and it was very easy to understand.

    • @edurekaIN
      @edurekaIN  4 роки тому +1

      Hey, thanks for the wonderful feedback! We are glad we could help. Do subscribe to our channel to stay posted on upcoming tutorials.

  • @muhammadjontursunov5097
    @muhammadjontursunov5097 8 років тому

    Thank you very much for vıdeo!
    Great tutorıal

    • @edurekaIN
      @edurekaIN  8 років тому

      +Muhammadjon Tursunov We are glad you liked it. You must also check out our blogs sometime @ edureka.co/blog/

  • @SmartProgramming
    @SmartProgramming 6 років тому +3

    wao, such a great explanation, very helpful video sir, thank you 👍👍

    • @edurekaIN
      @edurekaIN  6 років тому

      Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)

  • @surajpai104
    @surajpai104 8 років тому

    do you have java video lectures

    • @edurekaIN
      @edurekaIN  8 років тому

      Hey Suraj, thanks for checking out the tutorial! Here's the link to the Java tutorial playlist: ua-cam.com/play/PL9ooVrP1hQOFR25JoQW3h3n5pBs77e6KU.html. Cheers! :)

  • @bananaslayer901
    @bananaslayer901 2 роки тому +1

    You're amazing!

  • @nathankidd7595
    @nathankidd7595 6 років тому +1

    Thanks a ton for your help. BTW in the word "array" the emphasis is on the second syllable, "uh RAY."

    • @edurekaIN
      @edurekaIN  6 років тому

      Hey Natham thank you for watching our video. We will definitely keep this in mind :)

  • @simran8197
    @simran8197 6 років тому +1

    Well explained...I have already subscribed your channel for more such a helpful videos.

    • @edurekaIN
      @edurekaIN  6 років тому

      Thank you for subscribing to us Simran. Stay tuned for updates on our channel. Cheers :)

  • @prekshapatil468
    @prekshapatil468 6 років тому +2

    It helps a lot to me..... Thank U So Much..... 😊😉

    • @edurekaIN
      @edurekaIN  6 років тому

      Hey Preksha! We are delighted to know that you liked our videos. Subscribe, like and share to stay connected with us. Thanks :)

  • @nooramieranatashawizan2873
    @nooramieranatashawizan2873 7 років тому +1

    can we just use int a[ ] instead of int arr[ ] in the subprogram of largest number ?

    • @edurekaIN
      @edurekaIN  7 років тому

      +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!

  • @dmabhishek
    @dmabhishek 8 років тому +2

    This helped me a lot.Thank you!

    • @edurekaIN
      @edurekaIN  8 років тому +1

      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!

  • @innocentcoco7389
    @innocentcoco7389 6 років тому +1

    Helpful great job .. 👍👍

  • @manikantavaddepalli1597
    @manikantavaddepalli1597 7 років тому +1

    Nice explanation thank you

  • @Anuhas_D
    @Anuhas_D 6 років тому +1

    thankss

  • @sameerpal2474
    @sameerpal2474 7 років тому +1

    int take 2byte memory. not 4byte¿¿¿

    • @edurekaIN
      @edurekaIN  7 років тому +2

      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!

  • @why_ynwa
    @why_ynwa 5 років тому +1

    Thanks

  • @nothingtosay4313
    @nothingtosay4313 2 роки тому

    Watching after 7 years after uploading and this is still incredible ❤️
    Thank you ❤️

    • @edurekaIN
      @edurekaIN  2 роки тому

      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 !

  • @khajeshnarayana4407
    @khajeshnarayana4407 4 роки тому

    Nice video i learnt perfectly through edureka

  • @ciphergates5596
    @ciphergates5596 8 років тому +1

    AND NICE TUTORIALS.

    • @edurekaIN
      @edurekaIN  8 років тому

      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!

  • @meetashale9270
    @meetashale9270 6 років тому +1

    Nice explaination

    • @edurekaIN
      @edurekaIN  6 років тому

      Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)

  • @curiousbit9228
    @curiousbit9228 6 років тому +1

    That is beautiful!!

    • @edurekaIN
      @edurekaIN  6 років тому

      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 :)

  • @peiquedq
    @peiquedq 8 років тому +1

    Thank you, this helped me very much!

    • @edurekaIN
      @edurekaIN  8 років тому

      Glad you liked it! Do keep checking back in for more videos. You must also check out our blog page sometime @ Edureka.co/blog/

  • @GirlGoesWhoopWhoop
    @GirlGoesWhoopWhoop 7 років тому

    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?

    • @edurekaIN
      @edurekaIN  7 років тому

      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!

  • @SharadGaur0609
    @SharadGaur0609 7 років тому

    12:42 how can accessing a value in memory out of range of array size corrupt a memory ?

    • @edurekaIN
      @edurekaIN  7 років тому

      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

  • @shahanaalam7791
    @shahanaalam7791 7 років тому +1

    niceee vide0

    • @edurekaIN
      @edurekaIN  7 років тому

      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!

  • @thelasttimeitookashowerwas7069
    @thelasttimeitookashowerwas7069 6 років тому

    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

    • @edurekaIN
      @edurekaIN  6 років тому

      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 :)

  • @bharatshankar5
    @bharatshankar5 8 років тому

    why u write system("pause"); please explain clearly

    • @edurekaIN
      @edurekaIN  8 років тому

      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.

  • @surajpai104
    @surajpai104 8 років тому

    why have you intialized a[10]=0

    • @edurekaIN
      @edurekaIN  8 років тому +1

      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!

  • @kaiochanx3348
    @kaiochanx3348 7 років тому

    what is system("PAUSE") and what does it do?

    • @edurekaIN
      @edurekaIN  7 років тому +1

      +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!

    • @kaiochanx3348
      @kaiochanx3348 7 років тому +1

      +edureka! Oh right, thanks for the information, great video

  • @ciphergates5596
    @ciphergates5596 8 років тому

    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.

    • @edurekaIN
      @edurekaIN  8 років тому +1

      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.

    • @ciphergates5596
      @ciphergates5596 8 років тому +1

      GOT IT. THANKYOU

    • @SharadGaur0609
      @SharadGaur0609 7 років тому

      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) ?

    • @ciphergates5596
      @ciphergates5596 7 років тому +1

      Thankyou .

    • @edurekaIN
      @edurekaIN  7 років тому

      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!

  • @emmanuelamoh7181
    @emmanuelamoh7181 4 роки тому

    This was really helpful man! I understand how to work with arrays now!