C++ dynamic array - via copying two arrays
<p>I need to resize an array and copy the values there... So I know, that I need a dynamic array, but I can't use <code>vector</code> and must use static array ..I wrote something like this:</p>

<pre><code>string names1[0];

bool foo(const char * inFile1) {
int size = 0;
ifstream myfile(inFile1);
if (myfile.is_open()) {
    // iterate through lines
    while (getline(myfile, line)) {            
        string tmp[++size];
        for (int i=0; i!=size;i++)     
            tmp[i]=names1[i];
        names1=tmp;
        names1[size]=line;
    }
}
}
</code></pre>

<p>Nevertheless on line <code>names1=tmp;</code>  I get</p>

<pre>
main.cpp:42:20: error: incompatible types in assignment of ‘std::string [(((unsigned int)(((int)(++ size)) + -0x000000001)) + 1)]’ to ‘std::string [0]’
</pre>

<p>...I'm new to C++ and as a javaguy, I'm really confused :-S Thanks for any advice, how to solve this..</p>
