title: Pointer to a variable and pointer to an array of one element
body: <p>I am writing a socket programming application. C++ and Java as two ends. My system
  is in Java and applications using my system uses C++.</p>
  
  <p>I receive a pointer from C++ which holds some data, it could be a variable or an array. 
  There is another variable nrOfData which tells how many elements the pointer contains.
  I have to fill an Object of type String or String[] accordingly.
  <b>But my problem is, nrOfData==1 then there is posibility for both a varaible or array(array containing one element)</b>
  I am giving a sample program here(tried to get more similar one)</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  
  void func(string **strPtr)
  {
    if(someCondition)
    {
       *strPtr = new string;
    }
    else
    {
       *strPtr = new string[1];
    }
  }
  
  int main()
  {
     string *strPtr;
     func(&amp;strPtr);
     /* I have to fill a variable and send to next level 
     strPtr contains one element in both cases. How could i determine whether
     I need to fill String or String[]*/
  }
  </code></pre>
  
  <p>I should be strict to the requirement.
  Thanks for your help !</p>