How to use the arrow operator in C to access the member variables of a struct when we have a pointer to the struct. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!
Пікірлер: 51
@CoolModderJaydonX3 ай бұрын
Keep in mind, when using malloc on something, use free to free the allocated memory when you no longer need it.
@iwannapressit6886 Жыл бұрын
thank you showing both ways to point to something!
@PortfolioCourses Жыл бұрын
You're very welcome! :-)
@thesuperiorman8342 Жыл бұрын
Thank you so much. Well presented and to the point 👍
@PortfolioCourses Жыл бұрын
You’re very welcome, I’m glad you enjoyed it! :-)
@abdulsametaybaz3321 Жыл бұрын
Thanks your explaining and speaking so clear I can understand easily
@PortfolioCourses Жыл бұрын
You're welcome Abdulsamet! :-)
@pixelgamesSARLS4 ай бұрын
So well explained! Thank you
@mr.luxxyandreneo5168 Жыл бұрын
Nice explanation
@PortfolioCourses Жыл бұрын
I’m glad you enjoyed the explanation! :-)
@LexElls2 жыл бұрын
Thanks for supplying the code! That's awesome
@PortfolioCourses2 жыл бұрын
You're welcome Lex! :-D
@elisha502 Жыл бұрын
if im using an arrow how do i scan into those varibale?
@ratdude0108 ай бұрын
Magic, you need to call Harry Potter. I'm actually wondering the same thing.
@mementomori71607 ай бұрын
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
@ladyville37 ай бұрын
It would do it all the time, even when you don’t want it to?
@jeremykhoo51275 ай бұрын
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
@dimpe5038 Жыл бұрын
Really nice explanation, thanks!
@PortfolioCourses Жыл бұрын
You’re welcome, I’m glad you enjoyed the explanation! :-)
@zattirizortzort486 Жыл бұрын
Very well explained. Thanks
@PortfolioCourses Жыл бұрын
You’re welcome Ulas, I’m glad you enjoyed the explanation! :-)
@michasmykowski57535 ай бұрын
Thanks man You really made my day
@erennkose Жыл бұрын
Thanks for these videos i hope i can pass my exams.
@PortfolioCourses Жыл бұрын
You're welcome Aaron, and good luck on your exams! :-)
@FELIPEGABRIELMARQUESDOSSANTOS7 ай бұрын
thanks man. I finally get it 😅
@avixx6 ай бұрын
Love this!
@marbles5590 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
@@marbles5590 I suppose you are using c++ compiler . You need to change your main.cpp to main.c
@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 Жыл бұрын
hello from Brasil. thanks!
@PortfolioCourses Жыл бұрын
You're welcome! :-) And hello from Canada!
@radomeditv Жыл бұрын
clear in very helpful
@PortfolioCourses Жыл бұрын
Awesome, I’m glad to hear that! :-)
@ionguzun39522 жыл бұрын
Thank you!
@PortfolioCourses2 жыл бұрын
You’re welcome Ion! :-)
@aravinthr607 Жыл бұрын
Thank you sir ...
@PortfolioCourses Жыл бұрын
You're welcome! :-)
@iuseyoutubealot Жыл бұрын
what text editor r u using
@PortfolioCourses Жыл бұрын
In this video I am using Xcode on a Mac. 🙂
@awekeningbro12078 ай бұрын
when we use char data types for this, it doesnt work.