Declaring & Initializing Pointers in C

Поділитися
Вставка
  • Опубліковано 1 кві 2019
  • C Programming: Declaring & Initializing Pointers in C
    Topics discussed:
    1) Declaration of the pointer variable.
    2) Initialization of pointer variable.
    3) Address of operator.
    C Programming Lectures: goo.gl/7Eh2SS
    Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
    Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
    Contribute: www.nesoacademy.org/donate
    Memberships: bit.ly/2U7YSPI
    Books: www.nesoacademy.org/recommende...
    Website ► www.nesoacademy.org/
    Forum ► forum.nesoacademy.org/
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    #CProgrammingByNeso #CProgramming #Pointers #PointerDeclaration #PointersInC

КОМЕНТАРІ • 109

  • @shitanshusajal6456
    @shitanshusajal6456 3 роки тому +77

    These are literally one of the the best lectures I ever attended in my life!!

  • @irahazda
    @irahazda 3 роки тому +15

    This is the video that finally made me understood what are pointers and how to use it. At 2:30 when you explained that the ampersand means 'ADDRESS OF operator', that really clear things up. It's the little explanation like this that makes the difference between a good teacher and an average one.

  • @zsoca31
    @zsoca31 3 роки тому +47

    A lot of other "teachers" should check out this lesson to see how to actually teach a concept that one can use afterwards and not just understand temporarily and in the context of that particular video. Thank you!

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

    Time and time again you have the best tutorials on UA-cam. Thank you so much!

  • @olzhasdossaibek1642
    @olzhasdossaibek1642 4 роки тому +140

    How can i like your video multiple times?

  • @TigerHasGame
    @TigerHasGame 3 роки тому +16

    I could not understand the concept of pointers during class for the life of me. Saw this video and the concept just clicked in my head. Thank you for the upload!

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

      CS50?

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

      @@joshscores3360 Negative ghost rider, its a 4000s number course at my school.

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

      @@TigerHasGame the pointers lesson was probably the first time Professor Malan had admitted something was really confusing, so it made me freak out a little.

  • @NNNedlog
    @NNNedlog 2 роки тому +4

    You really helped simplified this concept. I have been struggling with pointers

  • @sohailanjum1539
    @sohailanjum1539 2 роки тому +4

    Mind blowing explanation sir,heads up. I see many lectures on pointer s but not get it well.After listening to your , I m very much clear.

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

    Excellent explanations. Thank you.

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

    Best videos ever, nice work and thanks for helping us.

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

    Litreally awsome and calm teaching👏

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

    Finally a short, concise explanation that is straight to the point and using clear terms!

  • @smartwolf9045
    @smartwolf9045 3 роки тому +1

    Thanks for the great content, just subscribed.

  • @naveed4246
    @naveed4246 4 роки тому +2

    Your teaching skills are too good

  • @MutungaKasamu
    @MutungaKasamu 3 роки тому +3

    Make videos on c++,your lectures are amazing

  • @wilsonbarbosa8210
    @wilsonbarbosa8210 10 місяців тому +1

    Holy fuck dude! Your channel is fucking amazing! You able to explain concepts with such simplicity and effectiveness as well. One thing that helps a lot are the animations and just the visual styling in general. My teachers only use their hands and raw code to teach us. Thank you so much for your videos! Keep up the good work!!!

  • @bsit3-1ngerardmarkperalta45
    @bsit3-1ngerardmarkperalta45 3 роки тому +6

    Neso Academy taught me what I can"t understand to what my Prof taught

    • @gvarun0403
      @gvarun0403 3 роки тому +2

      I'll complain to your professor

  • @alexbravo7467
    @alexbravo7467 3 роки тому +5

    Woow, fantastic !, excellent explanation of such a simple concept .. Thanking you ! .. :)

  • @manusharma9089
    @manusharma9089 3 роки тому

    love you sir ! ........you are awesome .

  • @youssef.Ftrader
    @youssef.Ftrader 5 років тому

    ty
    waiting for next lecture

  • @VinayakH
    @VinayakH 3 роки тому

    Please continue such lectures

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

    Outstanding sir

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

    phenomenal

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

    My favt channel is neso academy..our presentation is fabulous sir

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

      In my rating, Neso Academy is the best! I have not even met a prof. who teaches as best as these guys.

  • @MASadat-lz9yz
    @MASadat-lz9yz 5 років тому

    Thanks bro

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

    Awesome explanation wow

  • @tushar3879
    @tushar3879 3 роки тому +1

    Thank you so much

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

    Very good Video!

  • @deepika-hj7vu
    @deepika-hj7vu Рік тому

    Thank you, sir.

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

    thank you sir

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

    man, you are loud and clear. 🤩 🤩 🤩 🤩

  • @NishaSharma-nd1dk
    @NishaSharma-nd1dk Рік тому

    Thanks a lot

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

    I wish I had then when I was in school, but it's still helpful later as reference.

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

    Super helpful❤

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

    thank you bruh you're a GOD

  • @ritheshjarvis4177
    @ritheshjarvis4177 3 роки тому

    Thanks man.

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

    thanks man

  • @user-uf8rm8is1z
    @user-uf8rm8is1z 7 місяців тому

    thank you friend

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

    good explaining

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

    thanks

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

    Can you please share the notes of all lectures?

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

    Perfect !!!!

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

    Got it❤

  • @divyadharshini2980
    @divyadharshini2980 3 роки тому +2

    Addict in programming coz of neso

  • @rodwangd2683
    @rodwangd2683 3 роки тому +3

    صلوا على الحبيب المصطفى صلى الله عليه وسلم.-

  • @ShubhamMishra-mz4zw
    @ShubhamMishra-mz4zw 3 роки тому +3

    Great explanation....I am watching the entire series from function...

  • @prafful_sahu
    @prafful_sahu 4 роки тому +6

    3:45
    I'm confused on left sir u have wrote ptr = &x; and on right it's *ptr = &s; how??

    • @vanditdubey
      @vanditdubey 4 роки тому +3

      Yeah 🤣

    • @vudhanthineeraja1904
      @vudhanthineeraja1904 4 роки тому +3

      Hey there! let me give you an example using just integers: so assuming you know that integers can be declared as int a,b,c; instead of int a; int b; int c; and next we also know that it can be initialized as int a=2,b=3,c=4; instead of int a=2; int a=3; int c=4; so here we can do the same thing with the pointers we can declare and initialized at the same time so we code it as int x=5,*ptr=&x; instead of int x=5; int *ptr; ptr = &x; (please remember a pointer is also a variable but instead stores the address of another variable.) Hope you understood. Happy learning! :)

    • @prasantanayak6941
      @prasantanayak6941 3 роки тому +4

      Han woh sir thoda galat kar diyen hain I guess

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

      Yeah, I didn't get this point?
      Can anyone please explain this to me.

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

      ​@@vudhanthineeraja1904that's not our doubt if *ptr points out to the object of the data stored in ptr, then Assigning &x to the pointer ptr would just change the value of the variable to its address itself. Wait I explain it with an example , x=100 and &x = 1000 , ptr = &x means ptr stores the address of x and it is 1000 and *ptr = 100 means it would store the value found in the address mentioned in ptr and so *ptr = &x would mean, we are assigning the address of that x itself ( 1000) to the pointer which is not making any sense

  • @alexrocha6377
    @alexrocha6377 19 днів тому

    Basicaly it points to the SPACE of memory that another var is occupying, and NOT to the var value itself.

  • @monunirwan3056
    @monunirwan3056 5 років тому

    Where is D.T.F.S. representation of periodic signals in signals and systems

  • @keanu5085
    @keanu5085 5 років тому +6

    3:31 Cool :D Never thought of that xD

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

      it works, but readability is reduced

  • @flopchannel6103
    @flopchannel6103 5 років тому

    Power systems kab suru karooge sir........

  • @flopchannel6103
    @flopchannel6103 5 років тому

    I am waiting for ur reply and lecture

  • @rohitpurigoswami4029
    @rohitpurigoswami4029 3 роки тому

    Can pointers change the value of constant variable ??
    If we give the address of constant variable to a pointer.

    • @sukhbeersingh5811
      @sukhbeersingh5811 3 роки тому +1

      No because the pointer stores the address of variable in the memory location not the values.

    • @rohitpurigoswami4029
      @rohitpurigoswami4029 3 роки тому

      @@sukhbeersingh5811 thanks sir

  • @jasminejena8674
    @jasminejena8674 3 роки тому +3

    Sir, I am confused at 3:38 you wrote ptr=&x , so how on can you also write *ptr=&x. Shouldn't *ptr=x be correct?

    • @whatup20eleven
      @whatup20eleven 3 роки тому +1

      1:30...last point...

    • @sukhbeersingh5811
      @sukhbeersingh5811 3 роки тому +1

      No because the pointer stores the address of variable x and to refer the address we use &(ampersand) before x.

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

      ptr= name of a space in the memory
      And every space in memory has an address and a value stored in it ( it could be garbage value too)
      *ptr => ptr is a pointer variable
      *ptr =value stored at the place names "ptr"
      What are we storing in this space?
      The address of x! And in our language it is expressed as &x
      So store &x in the space named "ptr"
      *ptr=&x

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

      @@iamjust1normalgirlfromindi446 ok but there is albo ptr=&x (without the star)

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

      @@iamjust1normalgirlfromindi446 ok so did he forgot to put a * beside ptr at 2:38 ?

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

    Network theory classes sir

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

    I thank god every day for random Indian guys on youtube

  • @user-oi7zf2ho5j
    @user-oi7zf2ho5j 9 місяців тому

    omg thank you it was useful

  • @khalidabbasjan5815
    @khalidabbasjan5815 5 років тому +2

    iqra University 😍

  • @ranjansisodia6675
    @ranjansisodia6675 4 роки тому +2

    sir i think we can,t write *ptr=&x,int *ptr=&x should be right

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

      He has written int x = 5, *ptr = &x
      Int is applied to *ptr automatically

    • @whatup20eleven
      @whatup20eleven 3 роки тому

      Are you guys developing a spaceship to go to neptune yet... Since u have been on this topic for a year??

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

      Yo actually *ptr =&x shows error it's either ptr=&x or *ptr=x

  • @cidilicodolo3272
    @cidilicodolo3272 3 роки тому

    Can you add subtitle for each lecture? My English is not good

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

    This is the whole syllabus of Data Structures?

  • @doddivenkatesh934
    @doddivenkatesh934 3 роки тому

    Sir English to Telugu cheppavachu kadha...?

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

    When the friendly youtube tutorial helps more then real education

  • @arpitkesarwani6123
    @arpitkesarwani6123 5 років тому

    How to point the addresse of pointer variable?

    • @FICHEKK
      @FICHEKK 5 років тому

      You can create a pointer to another pointer, so called double-pointer.

    • @dancingpillow8951
      @dancingpillow8951 5 років тому

      By using ("%p",pointer variable)

  • @Atulkumar-ps2rd
    @Atulkumar-ps2rd 3 роки тому

    Sir,
    What is base address meaning ??

    • @kO_EC
      @kO_EC 3 роки тому

      The 1st address or starting index address like ex: array[0] has address 1000.

  • @SnehalZambare-sr8gh
    @SnehalZambare-sr8gh Рік тому

    * is called as asteric symbol

  • @dominionprodeus5883
    @dominionprodeus5883 5 років тому

    *Ty*

  • @gostatus2030
    @gostatus2030 5 років тому

    How much storage space required for the pointer to store the address of another variable....?

    • @FICHEKK
      @FICHEKK 5 років тому

      Depends, but it is usually 4 bytes, which is 32 bits.

  • @anaksimandros00
    @anaksimandros00 3 роки тому +1

    please add subtitle pls :(

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

    Hi

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

    Pointer is very useful. It is around two operators: memory address (&) and memory access (*)

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

    𝔸𝕞𝕒𝕫𝕚𝕟𝕘 𝕖𝕩𝕡𝕝𝕒𝕟𝕒𝕥𝕚𝕠𝕟 🥰🥰🥰🥰🥰🥰🥰🥰🥰

  • @bsit3-1ngerardmarkperalta45
    @bsit3-1ngerardmarkperalta45 3 роки тому

    🙇‍♂️❤️🇵🇭

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

    I am Back

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

    #include
    int main()
    {
    int x = 5;
    printf("the value of x = %d
    ", x);
    printf("the address of x = %p
    ", &x);
    printf("--------------------------------
    ");
    int *ptr;
    ptr = &x;
    printf("the value of the pointer ptr = %p
    ", ptr);
    printf("The Address of X is Equal to the value of the pointer ptr
    ");
    printf("(&x) : = (ptr value)
    ", &x, ptr);
    printf("the address of the pointer ptr = %p
    ", &ptr);
    }
    Output :
    ""
    the value of x = 5
    the address of x = 011ffabc
    --------------------------------
    the value of the pointer ptr = 011ffabc
    The Address of X is Equal to the value of the pointer ptr
    (&x) : = (ptr value)
    the address of the pointer ptr = 011ffab8
    ""