I have a byte array (vector <char> and I want to copy each byte to string):
The code:
The program crashes at the copy line.. What am I doing wrong?Code:using namespaces std; vector <char> v; v.resize(20); //..fill the vector.. // now copy string str; copy(v.begin(), v.end(), str.begin());