Hello, I am learning about ways of initializing strings from other containers. One of the tasks is to initialize a string from a char vector, but something goes wrong, and the book doesnt show an example on how to the initialization with another container besides an array.
Code:
vector<char> cvec = { 'H', 'i' };
string s1(cvec, 2);
I think it should look something like this.
I have tried to write it 3-4 different ways, but nothing has worked.
If anyone could show me the correct syntax, I would be very grateful!