Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - There is a vector, how to assign the contents of the vector to a character array like char a[ 100] one by one?
There is a vector, how to assign the contents of the vector to a character array like char a[ 100] one by one?
Vector & ltint & gtvec

vec . push _ back( 1);

vec . push _ back(2);

vec . push _ back(3);

vec . push _ back(4);

for(int I = 0; I< vec. size () & & I< 100; i++)

{

a[I]=(char)vec[I];

}