Arrow Operator For Pointers To Structs | C Programming Tutorial

Поделиться
HTML-код
  • Опубликовано: 27 дек 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 .

  • @HindiTV-jk1de
    @HindiTV-jk1de 10 дней назад

    Most simple pointer syntax video

  • @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! :-)

  • @abdulsametaybaz3321
    @abdulsametaybaz3321 2 года назад +4

    Thanks your explaining and speaking so clear I can understand easily

  • @mementomori7160
    @mementomori7160 11 месяцев назад +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

  • @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

  • @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.

  • @pixelgamesSARLS
    @pixelgamesSARLS 8 месяцев назад +1

    So well explained! Thank you

  • @mr.luxxyandreneo5168
    @mr.luxxyandreneo5168 Год назад +1

    Nice explanation

  • @LexElls
    @LexElls 2 года назад

    Thanks for supplying the code! That's awesome

  • @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 😅

  • @dimpe5038
    @dimpe5038 Год назад

    Really nice explanation, thanks!

    • @PortfolioCourses
      @PortfolioCourses  Год назад +1

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

  • @zattirizortzort486
    @zattirizortzort486 Год назад

    Very well explained. Thanks

    • @PortfolioCourses
      @PortfolioCourses  Год назад +1

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

  • @SameerAhmed-wf8yf
    @SameerAhmed-wf8yf 8 месяцев назад

    which IDE are you using?

  • @michasmykowski5753
    @michasmykowski5753 8 месяцев назад

    Thanks man You really made my day

  • @iuseyoutubealot
    @iuseyoutubealot 2 года назад +1

    what text editor r u using

  • @awekeningbro1207
    @awekeningbro1207 11 месяцев назад

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

  • @pirasannanmusicals
    @pirasannanmusicals 4 месяца назад

    what text editor u r using

  • @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! :-)

  • @hicg
    @hicg 2 года назад

    hello from Brasil.
    thanks!

  • @avixx
    @avixx 9 месяцев назад

    Love this!

  • @EngineeringNibbles
    @EngineeringNibbles 2 месяца назад

    Useful!

  • @radomeditv
    @radomeditv Год назад

    clear in very helpful

  • @aravinthr607
    @aravinthr607 Год назад

    Thank you sir ...

  • @ionguzun3952
    @ionguzun3952 2 года назад

    Thank you!

  • @joaco.
    @joaco. 2 года назад

    You are godlike.

    • @PortfolioCourses
      @PortfolioCourses  2 года назад

      Aww haha thank you very much for the support. :-)

  • @hakant.5806
    @hakant.5806 11 месяцев назад

    👍