[C++ STL] find() - 범위(Vector, Array..) 내에서 값을 탐색하는 함수
·
Archive/C&C++
C++ STL find Function *개인적인 공부 내용을 기록하는 용도로 작성한 글 이기에 잘못된 내용을 포함하고 있을 수 있습니다. _reference https://www.cplusplus.com/reference/algorithm/find/ #find 에 정의되어 있다. template InputIterator find (InputIterator first, InputIterator last, const T& val) { while (first!=last) { if (*first==val) return first; ++first; } return last; } find() 함수는 일련의 자료구조(Array, Vector, Deque..)내에서 원하는 값을 탐색하는 함수이다. 범위(first부터..
[C++ STL] string.find() - 문자열에서 원하는 문자열을 탐색한다.
·
Archive/C&C++
*개인적인 공부 기록용으로 작성한 글 이기에 잘못된 내용을 포함하고 있을 수 있습니다. size_type find(const basic_string& str, size_type pos = 0) const; // (1) size_type find(const CharT* s, size_type pos, size_type count) const; // (2) size_type find(const CharT* s, size_type pos = 0) const; // (3) size_type find(CharT ch, size_type pos = 0) const; // (4) template size_type find(const T& t, size_type pos = 0) const; // (5) string의 ..