C++의 벡터
3399 단어 cpp
Vectors in C++
런타임 중에 크기를 변경할 수 있는 배열을 나타내는 시퀀스 컨테이너입니다. 요소에 대해 연속적인 저장 위치를 사용합니다.1D 벡터
통사론
vector<data_type> variable_name
vector<int> vect;
벡터의 초기화

벡터에 대한 반복
1
vector<int> vect(n, 10);
for (int x : vect)
cout << x << " ";
2
vector<int> vect(n, 10);
// Traversing the vector using
// values directly
// no need to define datatype of vector
for (auto& it : vect) {
// Print the values
cout << it << ' ';
}
벡터에 요소 삽입

벡터의 요소에 액세스

벡터 요소 삭제

기타 기능

왜 벡터인가?
Reference
이 문제에 관하여(C++의 벡터), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/bhavinvirani/vector-in-c-4550텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)