And that would access the value pointed by a hypothetical pointer member called title of the structure object pmovie (which in this case would not be a pointer)."
I need a simple coding example of this as i have tried to use those two lines of code to do what it describes and i have tried for hours to figure out how to use them.
I understand that i am probably overthinking or missing something simple but a simple example using "*pmovie.title or *(pmovie.title)" to access the value pointed by a hypothetical pointer member called title of the structure object pmovie would be so extremely helpful!
I have literally been trying to figure it out the whole night. (It is 5:30 am now)
And that would access the value pointed by a hypothetical pointer member called title of the structure object pmovie (which in this case would not be a pointer)."
I need a simple coding example of this as i have tried to use those two lines of code to do what it describes and i have tried for hours to figure out how to use them.
Because pmovie is a pointer, you cannot use the dot notation with it unless the forms introduced prior to these are used as well. These forms will never be valid when pmovie is a pointer.
You can ignore the "And that..." sentence. It is very awkwardly worded. The one to pay attention to is:
Both expressions pmovie->title and (*pmovie).title are valid and both mean that we are evaluating the member title of the data structure pointed by a pointer called pmovie. It must be clearly differentiated from (the invalid expressions:)
struct test{
int* pointer; //creates a pointer to int which is a member of the struct
}obj;
int g;
obj.pointer=&g;
*obj.pointer=12; //sets the value of g to 12