Please note that while the Cat Plus Plus solution will work for you, it is recommended to use such things in C ++ 03 (until lambdas is in the upcoming standard version), use standard library algorithms and functors. Unfortunately, in some cases they are quite confusing, but in this case I think they give a clearer code:
std::copy(second.begin(), second.end(), std::back_inserter(first));
source
share