-
[C++] vector에 원소 추가하기공부/C, C++ 2021. 10. 10. 17:00
board[r][c]에 원소를 추가하고 싶을 때
vector <추가할 원소 형식> board[N][N]; 으로 선언 후
board[r][c].push_back(추가할 원소); 해주면 된다.
이런식으로!!
'공부 > C, C++' 카테고리의 다른 글
[C++] 공백으로 문자열 자르기, for each문 (나중에 포스트 하기) (0) 2022.03.18 [C++] string 공백 포함 입력, 입력 버퍼 비우기 (0) 2022.01.31 [C++] sort( )를 이용한 구조체 정렬 (0) 2022.01.12 [C++] struct형의 vector를 함수 인자로 넘기기 (0) 2021.10.08 [C] 배열의 주소 (0) 2021.08.29