Write member access to a pointer structure instead of using the "->" operator

Asked

Viewed 76 times

2

How would you write this assignment:

p1->caracter='B';

otherwise using * instead of ->?

1 answer

2


You first take the value of the object and then access the member normally:

(*p1).caracter = 'B';

I put in the Github for future reference.

This operator is just a form of overreact the pointer and access its member.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.