pointer problems?
<p>buffer is a protected void* part of my class btw</p>

<pre><code>   void* ptr;
   ptr= buffer;

   if(ptr == pvTxt)

        return ptr; 

    while (*((unsigned char*)ptr) || *(((unsigned char*)ptr)+1))
        ((unsigned char*)ptr)++;

        return *((unsigned char*)ptr)+1;
</code></pre>

<p>Everything up to the :</p>

<pre><code>             ((unsigned char*)ptr)++;
             return *((unsigned char*)ptr)+1;
</code></pre>

<p>is fine but I know there is  something wrong with the casting Any help in modifying it?</p>

<p>Also in my main I have :</p>

<pre><code>g_pvTxt = new unsigned char[BUFSIZE];  
memset (g_pvTxt,0,BUFSIZE);
</code></pre>

<p>Given the question above how do i append an array. Create an array/append to it. Can't use std::vector because it's an embedded system</p>

<p>To further explain the loop:</p>

<p>After an txt entry there is a null termination. At the end of all entries there is a double null. So, in the while loop if the value the pointer is pointing at is false (either 0 or 00) or ptr || ptr+1, it will increment the counter until it gets to the next spot where i can append values.</p>
