C++ beginners guide OOP issue

Hi this is my first post. So hope I can explain this right. I was doing the C++ beginner course to learn the syntax properly and thought it was good. Though when I got to the OOP side I came to a problem in the class members lesson in the class and objects session to realise the text guide doesn’t match up with the code and I needed to see the solutions to confirm it. The guide says methods have a “.” before them but when I did that it didn’t work but removing it did make the code work and found this out by the code solution. I think its an older version of C++ which the text guide was talking about but I’m not sure. Just thought I would type about it and let people know.