본문 바로가기

이우의 개발일지

검색하기
이우의 개발일지
프로필사진 공대이우

  • 분류 전체보.. (84)
    • Coding (52)
      • Androi.. (3)
      • Algori.. (17)
    • Embede.. (7)
    • Cloud .. (1)
    • Intern.. (2)
    • contro.. (1)
Guestbook
Notice
Recent Posts
Link
«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Archives
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록문자열 비교 (1)

이우의 개발일지

[C++] 문자열 비교 함수 만들기

문자열 비교 함수 만들기내가 지정한 문자와 입력한 문자가 같으면 종료, 다르면 계속하는 함수 #include #include #include#include using namespace std;const int kMaxstr = 100; // 전역변수 설정 bool IsEqual(const char st1[], const char str2[]) { for (int i = 0; i > str2; if (IsEqual(str1, str2)) { cout  ※주의할 점은 bool IsEqual 함수에서 if(st1[i] == str2[i])는 어차피 같으면 넘어가니깐, 굳이 안넣어줘도되는데 처음에 했을 때 안됐던 이유가else if (st1[i] == '\0') return true; else if (st..

Coding/Algorithm 2024. 5. 5. 18:42
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바