Arrow Operator For Pointers To Structs | C Programming Tutorial

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 55

  • @CoolModderJaydonX
    @CoolModderJaydonX 8 месяцев назад +18

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

  • @mb59621
    @mb59621 4 месяца назад +2

    Your teaching style delivers maximum knowledge in minimum time .

  • @iwannapressit6886
    @iwannapressit6886 2 года назад +15

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

  • @aybmix-25
    @aybmix-25 2 года назад +4

    Thanks your explaining and speaking so clear I can understand easily

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

    So well explained! Thank you

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

    Nice explanation

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

    Thanks for supplying the code! That's awesome

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

    thanks man. I finally get it 😅

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

    Really nice explanation, thanks!

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

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

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

    Thanks man You really made my day

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

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

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

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

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

    Very well explained. Thanks

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

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

  • @mementomori7160
    @mementomori7160 Год назад +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 Год назад +1

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

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

  • @elisha502
    @elisha502 Год назад +3

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

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

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

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

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

    hello from Brasil.
    thanks!

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

    Useful!

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

    Love this!

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

    clear in very helpful

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

    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

    • @SoftBreadSoft
      @SoftBreadSoft 11 дней назад

      it's syntax sugar to help keep track of what is a pointer. Arrays are automatically de-referenced so it would be standard to use dot here.

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

    which IDE are you using?

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

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

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

    Thank you sir ...

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

    what text editor u r using

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

    Thank you!

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

    what text editor r u using

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

    You are godlike.

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

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

  • @hakant.5806
    @hakant.5806 Год назад

    👍