강의

멘토링

커뮤니티

Inflearn Community Q&A

ehdgus50941207's profile image
ehdgus50941207

asked

Introduction to Algorithm Problem Solving for IT Employment (with C/C++): Coding Test Preparation

44. Choosing a stable (Application of binary search: decision algorithm)

vector<int>와 new int 차이가 궁금합니다.

Written on

·

626

0

vector로 배열을 선언한것과 new로 배열을 선언한 것이 어떤 차이점이 있는지 궁금합니다.

vector는 추가로 계속해서 늘려줄 수 있지만, new로 동적할당을 한번 받아버리면 그 뒤로 늘려줄순 없다는 제 생각이 맞나요?

추가로 vector와 new를 같이 사용할 수 있나요?

감사합니다.

코테 준비 같이 해요! C++

Answer 2

1

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 맞습니다. 저도 그정도의 차이점밖에 모릅니다. 

같이 사용할 수 있지만 코딩인터뷰같은 곳에서 코드짤때는 한가지로 일관성있게 짜는 게 좋습니다.

0

감사합니다!

ehdgus50941207's profile image
ehdgus50941207

asked

Ask a question