std::vector constructor with two input arguments [duplicate]
问题 This question already has answers here : What is array to pointer decay? (9 answers) Closed 2 years ago . I came across a piece of C++ code in one of my projects that initializes a vector with two inputs. One of the inputs is an existing array, and the other is the same array plus the array length. I found a similar piece of code on another site: // Create an array of string objects std::string arr[] = {"first", "sec", "third", "fourth"}; // Initialize vector with a string array std::vector