Arrow Operator For Pointers To Structs | C Programming Tutorial

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ • 55

  • @CoolModderJaydonX
    @CoolModderJaydonX 7 місяців тому +13

    Keep in mind, when using malloc on something, use free to free the allocated memory when you no longer need it.

  • @mb59621
    @mb59621 3 місяці тому +2

    Your teaching style delivers maximum knowledge in minimum time .

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

    thank you showing both ways to point to something!

  • @thesuperiorman8342
    @thesuperiorman8342 2 роки тому +20

    Thank you so much. Well presented and to the point 👍

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

      You’re very welcome, I’m glad you enjoyed it! :-)

  • @HindiTV-jk1de
    @HindiTV-jk1de 5 днів тому

    Most simple pointer syntax video

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

    Thanks your explaining and speaking so clear I can understand easily

  • @pixelgamesSARLS
    @pixelgamesSARLS 8 місяців тому +1

    So well explained! Thank you

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

    Thanks for supplying the code! That's awesome

  • @mr.luxxyandreneo5168
    @mr.luxxyandreneo5168 Рік тому +1

    Nice explanation

  • @mementomori7160
    @mementomori7160 10 місяців тому +2

    I know it's old but, why can't the compiler jsut dereference the pointer first? Do you know if there is a reson for that? That way they wouldn't need a completely new operator to exist

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

      It would do it all the time, even when you don’t want it to?

    • @jeremykhoo5127
      @jeremykhoo5127 8 місяців тому +1

      Sometimes you want to change the address of the pointer and not the value
      You have an address to a John's house. Set to Mary
      A postman subroutine has a pointers to "delivery for" it is set at adress: John's house
      Person: Marry
      So it means you will go to John's house and deliver the package to Mary who lives there
      If you always dereference that means you can only deliver to the people in John's house (Mary and John). You cannot deliver to anyone in Clements' house
      ie you can only change the value, you cannot change the address

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

    Thanks man You really made my day

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

    if im using an arrow how do i scan into those varibale?

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

      Magic, you need to call Harry Potter. I'm actually wondering the same thing.

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

    Really nice explanation, thanks!

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

      You’re welcome, I’m glad you enjoyed the explanation! :-)

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

    Do you or does anyone else know if I should use the dot operator or arrow operator if I am dealing with a structure array? I did something like this (*pointerName)[index ].elementName

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

    Very well explained. Thanks

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

      You’re welcome Ulas, I’m glad you enjoyed the explanation! :-)

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

    Thank you for this video... although I had problems in my code. It says 'cannot convert int* to Point'. I don't have any problems using the arrow operator and such, only this (*p3), p3-> thing after dynamically allocating using malloc().

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

      You're welcome! :-) And I'm not sure why that would be without seeing the code, can you maybe post your code in a comment here so I can look at it? I've posted the code in this video here: github.com/portfoliocourses/c-example-code/blob/main/arrow_operator.c.

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

      @@PortfolioCourses hello, I used another IDE and the code works. My code is just the same as yours. Maybe this error has something to do with my settings...

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

      ​@@marbles5590 I suppose you are using c++ compiler . You need to change your main.cpp to main.c

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

      @@Quasarsoft ty for that but i have already solved the prob months ago. Still there are times i get used to using the devc++ compiler and forgot to change it to .c 😅

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

    thanks man. I finally get it 😅

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

    Thanks for these videos i hope i can pass my exams.

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

      You're welcome Aaron, and good luck on your exams! :-)

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

    Love this!

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

    when we use char data types for this, it doesnt work.

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

    hello from Brasil.
    thanks!

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

    Useful!

  • @SameerAhmed-wf8yf
    @SameerAhmed-wf8yf 8 місяців тому

    which IDE are you using?

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

    clear in very helpful

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

    what text editor r u using

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

    what text editor u r using

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

    Thank you!

  • @joaco.
    @joaco. 2 роки тому

    You are godlike.

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

    Thank you sir ...

  • @hakant.5806
    @hakant.5806 11 місяців тому

    👍