I know this is a very simple question, but after a few google searches and clicking a few links, I still could not find the answer.
My question is what is the difference between "." and "->" in a function call in C ++?
For example, I have a program with two different data structures. Semaphore aaa; Bbb list;
To use the function on a semaphore, I have to do aaa.P (); but in List, I have to do List-> append (object);
I donβt quite understand why Semaphore uses .P (), whereas List uses β append () when the semaphore is just a data structure containing an integer and a list.
source share