What is the benefit of using a pointer C++ : <p>I Was just confused on the part of using a pointer on C++.. well you might say, "a pointer is obviously a memory adress of another variable and there are certaintly conditions in your program where you will need them". But i dont mean pointer in general, i mean the pointer you use to like "simulate" a class... I think code will explain it more:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include "Book.h"


int main() {
    Book book1;
    Book *bookPointer = &amp;book1;


    book1.setBooksId(123);
    std::cout &lt;&lt; "BOOK ID: " &lt;&lt; book1.getBookId() &lt;&lt; std::endl;

    (*bookPointer).setBooksId(300);
    std::cout &lt;&lt; (*bookPointer).getBookId() &lt;&lt; std::endl;

    /*When usage of arrow member selection member, left is always a pointer. 
      Same thing as above, but better practice!
      */

    bookPointer-&gt;setBooksId(100);
    std::cout &lt;&lt; "POINTER ARROW  : " &lt;&lt; bookPointer-&gt;getBookId() &lt;&lt; std::endl;
    return 0;
}
</code></pre>

<p>Here you see i have another pointer that is called bookPointer which all it does is the same as the original instance of book class book1... I dont get it.. What is the advantage of using this? Give me a scenario if you can! Thanks for Helping!!</p>
