Array & Pointers in C Programming with examples

Поділитися
Вставка
  • Опубліковано 10 січ 2022
  • 👉Subscribe to our new channel: / @varunainashots
    In this video we have discussed Array & Pointers in C Programming with examples.
    ►Programming in C (Complete Playlist):
    • C Programming
    Other subject-wise playlist Links:
    --------------------------------------------------------------------------------------------------------------------------------------
    ►Design and Analysis of algorithms (DAA):
    • Design and Analysis of...
    ►Database Management System:
    • DBMS (Database Managem...
    ► Theory of Computation
    • TOC(Theory of Computat...
    ►Artificial Intelligence:
    • Artificial Intelligenc...
    ►Computer Networks (Complete Playlist):
    • Computer Networks (Com...
    ►Operating System:
    • Operating System (Comp...
    ►Structured Query Language (SQL):
    • Structured Query Langu...
    ►Discrete Mathematics:
    • Discrete Mathematics
    ►Compiler Design:
    • Compiler Design (Compl...
    ►Number System:
    • Number system
    ►Cloud Computing & BIG Data:
    • Cloud Computing & BIG ...
    ►Software Engineering:
    • Software Engineering
    ►Data Structure:
    • Data Structure
    ►Computer Architecture :
    • Computer Organization ...
    ►Graph Theory (Complete Playlist):
    • Graph Theory
    ►Digital Logic:
    • Digital Logic (Complet...
    ---------------------------------------------------------------------------------------------------------------------------------------
    Our social media Links:
    ► Subscribe to us on UA-cam: / gatesmashers
    ►Subscribe to our new channel: / @varunainashots
    ► Like our page on Facebook: / gatesmashers
    ► Follow us on Instagram: / gate.smashers
    ► Follow us on Instagram: / varunainashots
    ► Follow us on Telegram: t.me/gatesmashersofficial
    ► Follow us on Threads: www.threads.net/@gate.smashers
    --------------------------------------------------------------------------------------------------------------------------------------
    ►For Any Query, Suggestion or notes contribution:
    Email us at: gatesmashers2018@gmail.com

КОМЕНТАРІ • 128

  • @mizanurrahaman1056
    @mizanurrahaman1056 2 роки тому +6

    Thank you so much, it's very helpful for interview preparation.

  • @sweetstar5623
    @sweetstar5623 Рік тому +10

    You are such a great teacher 👍👍

  • @abcdrabcds2306
    @abcdrabcds2306 2 роки тому +9

    Sir your work is great. Keep it up. Thank you so much

  • @Pujasahoo-wg3lr
    @Pujasahoo-wg3lr 7 місяців тому +1

    Sir your teaching style is very very very best. Thank you for helping us 🙏🙂

  • @factgoal1m
    @factgoal1m 10 місяців тому

    Thank you sir
    Very awesome style to teaching

  • @Rachana-chinhalli
    @Rachana-chinhalli 7 місяців тому

    Thank you so much sir you have given a very detailed explanation it was very helpful

  • @vaibhavshreenamdev8392
    @vaibhavshreenamdev8392 2 роки тому +43

    Sir C programming and Data structure basic se Advance tak ( whole syllabus ) par videos banaiye.

    • @shaikjohn7552
      @shaikjohn7552 2 роки тому +2

      S sir

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

    • @kaif7369
      @kaif7369 Рік тому +1

      Apko Mila notes

    • @salonizalte9320
      @salonizalte9320 Рік тому +1

      Yes sir

    • @saniaayoub5474
      @saniaayoub5474 Рік тому

      Plz sir

  • @babitadevi1412
    @babitadevi1412 Рік тому

    Waoo Sir meme to pahle baar apki video Dekhi hai or usne hi ek dam jkash Smj me aaya hai gjeb sir Ji gjeb

  • @MdAbulKasam-lp4pf
    @MdAbulKasam-lp4pf Рік тому +1

    awesome video. thank you so much.

  • @NidsFahad
    @NidsFahad 2 місяці тому

    You did great help of mine in understanding of pointers.

  • @triptishori6129
    @triptishori6129 Рік тому +4

    According to output this program is auto type storage...if it is static then o/p will be
    1 ,1,1,3,5,3

  • @usmankhanctit8380
    @usmankhanctit8380 2 роки тому +2

    Amazing method.

  • @akshathashenoy2130
    @akshathashenoy2130 Рік тому +4

    Typo in first program:
    p = x
    (as opposed to p = &x, since we are equating the two pointers p and x, which is a pointer pointing to the first element of the array)

  • @usamamobil5127
    @usamamobil5127 6 місяців тому

    Outstanding method Sir..✨

  • @PriyankaKumari-rt2ut
    @PriyankaKumari-rt2ut 2 роки тому +1

    As always enjoyed your vedios..

  • @AnjaliGalot
    @AnjaliGalot Рік тому +2

    Sir ajjj first time mujhe arrays and pointers clear hue

  • @Engr.MarwaKhalid
    @Engr.MarwaKhalid 2 роки тому +5

    Sir ! *P++ mein 1 answer aya but after answer, us ko 2 nhe ho jana cahiay. Next operation mein ++*p mein phr 2 use nhe ho ga??

  • @OnlineShoping841
    @OnlineShoping841 2 роки тому +2

    God bless you and your family

  • @Pankaj__singh20
    @Pankaj__singh20 Місяць тому

    Thank you sir , bahut knowledgeable video thi and easy to understand

  • @parbhatbansal1451
    @parbhatbansal1451 Рік тому +1

    Sir you are great thank you so much sir it is very very helpful for me thankyou sir

  • @anamikasahu10b47
    @anamikasahu10b47 Рік тому +1

    Thank you So much Sir🤩

  • @comp_yadnika_kotwal8368
    @comp_yadnika_kotwal8368 11 місяців тому +37

    CORRECTION:
    p=1000
    7:06
    after *p++ the p pointer is pointing to the second element, that is it will hold the address 1004, in the next line ++*p , address 1004 is dereferenced and the value at this address is incremented, i.e the 2nd element of the array changes to 3. *++p if we do then first p is incremented to 1008 and p now points to third element of the array and now dereferencing 1008 will give the third element 3

    • @mojito9695
      @mojito9695 7 місяців тому +2

      Yess...

    • @shawonhussain07
      @shawonhussain07 5 місяців тому

      I was about to write this .

    • @OvishaSanyal
      @OvishaSanyal 4 місяці тому

      Are you sure about it?

    • @OvishaSanyal
      @OvishaSanyal 4 місяці тому

      But output of *p++ will be 1 right?

    • @omkarjambhale1184
      @omkarjambhale1184 4 місяці тому

      @@OvishaSanyal ++ just move to next index like if we have *arr={5,8} so when we use *arr++ than move to 8 because by default arr will be arr[0] which is 5 and add to it we get arr[1] which is 8

  • @Honeyrathore440
    @Honeyrathore440 7 днів тому

    wow, and thank you it is really helpful

  • @vaibhavkottari8800
    @vaibhavkottari8800 Рік тому +2

    great video sir.....

  • @mehndi.6236
    @mehndi.6236 Рік тому

    Thank you sir...🙏🙏

  • @uttaranghosh2318
    @uttaranghosh2318 2 роки тому +7

    In ex 2 in the time of disp fun call that will be disp(a);
    Not disp(&a);
    I'm so much impressed by ur teaching style sir ❤️.

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

      yes correct

    • @symemoza104
      @symemoza104 Рік тому +1

      In array if you created,
      int a[] = {11, 22, 33, 44, 55};
      a == &a == &a[0]
      because a is a pointer in on itself.

    • @ashishkumaryadav5252
      @ashishkumaryadav5252 Рік тому +1

      disp(&a) is also correct, it will give same result for all operations.

    • @jishasen7328
      @jishasen7328 Рік тому +1

      @@ashishkumaryadav5252 disp (&a) did not work. display (a) works.

  • @AnuragRawat01
    @AnuragRawat01 Рік тому +2

    Fantastic 😊😊

  • @swatisingh6984
    @swatisingh6984 Рік тому

    When we r done with printf("%d", *p++ ) output=1 then X[0] will become 2 na???

  • @Foodies1215
    @Foodies1215 9 місяців тому +1

    you are great man

  • @akashshah8866
    @akashshah8866 Рік тому +1

    Awesome sir ji

  • @gatplace2738
    @gatplace2738 Рік тому +2

    Sir best work

  • @nainikamohanta6128
    @nainikamohanta6128 Рік тому

    Thankyouuu sir😌

  • @tusharsonawane3530
    @tusharsonawane3530 Рік тому +1

    Nice explanation

  • @kavyashree890
    @kavyashree890 2 роки тому +2

    Sir kindly start a course for ugc net

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

    Sir p++ post increment kyou use kre ge jb kuch hi nahi change hoga toh

  • @manjunathamakavalli
    @manjunathamakavalli 2 роки тому +11

    P++ means p=p+1;
    You are not using this increment for next lines of statements.

  • @SumitDavdra
    @SumitDavdra 10 місяців тому

    8.50 output will be 0 because, P++ and ++p ne index change kar diya. Sir

  • @amorphiouslattice1200
    @amorphiouslattice1200 Місяць тому

    sir *(p+4) is out of bound of array bcz p is pointing to X[1] at this point.

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

    Dear sir, kindly make a video on uppcl AE for cse

  • @JunaidKhan-iv7qh
    @JunaidKhan-iv7qh Рік тому

    Bahut shi padaya

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

    Tq sir

  • @gurpreetsinghsoos4512
    @gurpreetsinghsoos4512 Рік тому +3

    Thanks sir very easy method 🤍🤍🤍🤍🙏🙏🙏

  • @saniaayoub5474
    @saniaayoub5474 Рік тому

    Sir ap data structure k all topics pr complete playlist bnaay plz

  • @Aabara_ka_dabara
    @Aabara_ka_dabara Рік тому +1

    p++ should also increasing the address too..

  • @2012souls
    @2012souls 3 місяці тому

    Subscriber bohut jaruri hei 🎉

  • @Artaxerxes.
    @Artaxerxes. 2 роки тому +2

    Suggestion : use a monospace code font like jetbrains mono instead of times new Roman for code blocks.

  • @anshulanshul6751
    @anshulanshul6751 9 місяців тому +1

    Jai Shree Ram

  • @abhisheksinghrajput899
    @abhisheksinghrajput899 Рік тому

    Sir agar ham ne programming kar lene ke bad white printout kaise nikalwaye

  • @anshulanshul6751
    @anshulanshul6751 9 місяців тому

    Sir printf("%d", *p++)
    1kase aayega ye to 2 nahi aana chahiye tha

  • @sameerbvk1976
    @sameerbvk1976 11 місяців тому

    actually the pointer must point to x[0]. Else it would give an error

  • @skkidsstudy
    @skkidsstudy Рік тому

    Sir your output and actual system output not matching.. bit confusing who is right you or software ...++*p changeing actual data of array .. please do practical of this and clear the doubt..

  • @chittichinmayi9113
    @chittichinmayi9113 8 місяців тому

    P=X we can no
    P=ampersand x not needed??

  • @undefined_exception_0
    @undefined_exception_0 2 роки тому +7

    Sir you made a mistake at 6:30
    printf("%d",*p++); will give the answer 1 but will increment pointer p to its next location so pointer p will contain the address 1004 not 1000.

  • @ishukori9574
    @ishukori9574 11 місяців тому

    Sir pointer arithmetic in c concept
    1 video please

  • @NancySharmaArtCraft
    @NancySharmaArtCraft 8 місяців тому

    Sir int mai to 2 bytes hoti hai aapne 4bytes li hai

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

    And p-1 me kaise change hoga kaise address change hoga

  • @Koroki_Sensei_2245
    @Koroki_Sensei_2245 Рік тому

    Sir 2D array ka ek video post karona please

  • @AmitKumar-gk9wh
    @AmitKumar-gk9wh Рік тому

    Nice ❤️🤗👍

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

  • @netcracker7353
    @netcracker7353 3 місяці тому

    Aaj puri bca mca complete karne k baad muze ye samaj aaya

  • @mradulraj8777
    @mradulraj8777 6 місяців тому

    Sir sb smjh aa rha tha last wala program dikha Diya aapne.😂

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

    x == &x, when x is an array. Type of both though are different.

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

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

    Hello Sir

  • @subham_2004-c2y
    @subham_2004-c2y 3 місяці тому

    there is a mistake in your last example. The correct code is:
    #include
    void disp(int *x);
    int main()
    {
    int a[5]={1,2,3,4,5};
    disp(a);
    return 0;
    }
    void disp(int *x)
    {
    printf("%d
    ",*x);
    printf("%d",*(x+3));
    }
    // It disp(a) not disp(&a)

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

    Add subtitles for every video

  • @bhojaramsa9353
    @bhojaramsa9353 2 роки тому +6

    " *ptr++ " will print 1 but ptr will point to location 1004 as Postfix..
    Any reply is appreciated...

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

      Only legend know about that😉

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

      yeah you right about that

    • @sp8602
      @sp8602 Рік тому

      @@shahrukhrehman5157 pls tell then

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

    • @sultangaming3912
      @sultangaming3912 Рік тому

      @@sp8602 watch arithmetic videos for this

  • @tani3275
    @tani3275 7 місяців тому

    Why nothing changed in *p++??

  • @pokemon4you575
    @pokemon4you575 2 місяці тому

    4th Printf me 3 print hoga sir aapne galt bataya yaha

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

    Sir complete c kara dijiye request by heart

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

  • @THEgourav89
    @THEgourav89 Рік тому

    Padhate nhi ho aap but aaj glat pda diya sir ji

  • @yasiraroma
    @yasiraroma 4 місяці тому

    Brother let me correct you please.. disp () is called function whereas main is calling function.. u are using the words interchangeably...

  • @saheblalsorenmdeofficials4331

    Hii sir

  • @mdsarfrajsarfraj6727
    @mdsarfrajsarfraj6727 11 місяців тому +1

    Kuch samajh nahi aa Raha hai 😔😔

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

    background white screen is too bright pls alter

  • @Sipten630
    @Sipten630 Рік тому

    1 ,1 ,1 , 3 , 5 , 3

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

  • @sahilmalik-oi4df
    @sahilmalik-oi4df Рік тому

    sir mujhe bilkul bhi bura nahi lag raha ye bolte hua ki aap sourav sir se accha explain kerte ho 🙂

  • @crazy-bo3lv
    @crazy-bo3lv 2 роки тому

    First comment

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

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

    Computer teacher le sir btye ga

  • @vikashtanwer4184
    @vikashtanwer4184 7 місяців тому

    😶

  • @monoroma100
    @monoroma100 Рік тому +14

    Your Concept is not clear sir. Read Balaguruswami

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

    Sir plz spk in english or else please add english subtitles. We are not able to catch hindi with this much speed of talking.

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

  • @konglyngdoh5487
    @konglyngdoh5487 Рік тому +1

    Explain in English not in Hindi language ...

  • @Somu_Mane
    @Somu_Mane 9 місяців тому

    Sir may be o/p is wrong o/p is
    1
    1
    1
    3
    6422284 garbage value
    3
    o/p=1 according to post increment the value will be use first p++ is 0 after this 0 will be increment to 1 p=&a[1]
    then next ++*p , p=1 and it is o/p is *p=2 ++2=3;
    next *(p+4) here p=&x[2] 1008+4*4 = 1032 its gives garbage value
    next p=&x[2]; *p=3
    next op p=&x[2]; printf("%d",*(p-1)); its giving 3 but i can't understand this

  • @university-study
    @university-study Рік тому

    Cry n8ce

  • @Prince_07123
    @Prince_07123 10 місяців тому

    Ap kal student comments bhi unhi ladkiyo ka hi like karte hai bas😅😢
    Mera bhi comment ak din viral hoga😢😢

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

    void input_employeeDetail(struct employee *ptr1, int size)
    {
    int i;
    for (i = 0; i< size; i++)
    {
    printf("Enter details of(Id ,Name , Salary) %d employee : ", i + 1);
    scanf("%d", &(ptr1+i)->employee_id); // why use &(ptr1+1)->employee_id.
    fflush(stdin);
    gets((ptr1+i)->name); // but here is not use & symbol
    scanf("%f", &(ptr1+i)->salary);
    }
    }
    please replay
    i'm 😕 😕

    • @058laxmi8
      @058laxmi8 Рік тому

      ua-cam.com/video/KCoCasaWVAs/v-deo.html
      Check out this channel, here they are creating whole data structure playlist using C/C++

  • @er.anilkumargupta8662
    @er.anilkumargupta8662 Рік тому

    Re code hi apne sarir se chhupa leta hai, aur bad bad start