How to access a member of a pointer to object : <p>I need some clarification about this issue. I have a class called con. </p>

<pre><code>class con
{
 public:
 con();
 int readIndex;
}
</code></pre>

<p>in con.cpp:</p>

<pre><code>con::con()
{
readIndex = 0;
}
</code></pre>

<p>in main:</p>

<pre><code>con = new con();
</code></pre>

<p>now readIndex is not 0  as I wanted. Watch window shows that the value is <code>0xcdcdcdcd {???}</code> and the type is now <code>int*</code> and not <code>int</code> which means that a variable will become a pointer if it's class object is created using <code>new</code>? I then tried to change the code to <code>*readIndex = 0;</code> but I got a write access violation. So how should I set the value of readIndex to 0 after all?
`</p>
