[TIL] 21-06-29

0

TIL

목록 보기
18/104
post-thumbnail
post-custom-banner

알고리즘 스터디

📌참고자료

  • copy() 를 이용한 복사
destVector.resize((int)(sourceVector.size()));
std::copy( sourceVector.begin(), sourceVector.end(), destVector.begin() );
std::copy( sourceVector.begin() + 2, sourceVector.begin() + 5, destVector.begin() );
  • assign() 을 이용한 복사
destVector.clear();
destVector.assign( sourceVector.begin(), sourceVector.end() ); // 전체 복사
destVector.assign( sourceVector.begin() + 1, sourceVector.begin() + 4 );
profile
Be able to be vulnerable, in search of truth
post-custom-banner

0개의 댓글