C Programming Tutorial # 32 - Passing Structure Pointers to Functions [HD]

preview_player
Показать описание
In this tutorial we learn to pass structures to functions by reference.

This tutorial is part of the following series:
Рекомендации по теме
Комментарии
Автор

@arghyainfo Thanks for liking the videos. I really appreciate it. Looks like you have already watched all of them. I haven't posted this one on facebook yet. I have been making about 6 to 8 tutorials per week. Subscribe to the channel and you will be able to access my new videos in your Subscription section.

Learnorama
Автор

@itsdannyftw Answer to the question "why don't we need to?" is that this is in the way -> operator is defined. When you have a pointer to structure you can access its members using -> operator. If you have the structure itself then you use . (dot) to access the members. Now you can also write something like (*pRect).length instead of rect->length and that will work too. Why? Because *pRect represents the structure itself, and hence you can access its members with a . (dot). Cool huh!

Learnorama
Автор

this are all nice videos.thank u to help us
give me more videos to learn fast.

arghyainfo
Автор

good example and good answers! im a beginner and its interesting to know all about c++. do you recommend me some forum?

anonymous__
Автор

shouldnt rect1area be a pointer variable ????please reply

varunk
Автор

Are you sure when you parse a structure to a function it actually makes a COPY? Aren’t structures pass by reference?

Aemilindore