1/**
2 * @author Charles Salvia (StackOverflow)
3 *
4 * -> is to access a member function or member variable of an object through
5 * a pointer, as opposed to a regular variable or reference.
6 */
7
8// For example: with a regular variable or reference, you use the . operator
9// to access member functions or member variables.
10std::string s = "abc";
11std::cout << s.length() << std::endl;
12
13//But if you're working with a pointer, you need to use the -> operator:
14std::string* s = new std::string("abc");
15std::cout << s->length() << std::endl;