#define _CRT_SECURE_NO_WARNINGS


#include <stdio.h>

#include <string.h>


int main(void) {

char c1, c2, s[18] = "Kim Lee Park Choi";

int* ptr;


printf("문자열 s = %s ", s);

printf("문자열 시작 위치 = %d ", s);


printf(" ");


for (;;) {

printf("찾을 문자 입력 : ");

scanf("%c", &c1);


ptr = strchr(s, c1);


if (!ptr) printf("문자 '%c'(을)를 찾을 수 없음! ", c1);


else {

printf("문자 %c의 위치 = %d ", c1, ptr);


printf("교체할 문자 입력 : ");

scanf("%c", &c2);


printf("교체할 문자 인덱스 = %d ", ptr - s);

s[ptr - s] = c2;


printf("<결과> ");

printf("문자열 s : %s", s);


break;

}

}

return 0;

}


"Kim Lee Park Choi" 라는 문자열에서 z라는 문자가 없으니까 if문 실행 후 다시 scanf 함수로 문자를 받아야 하는데

a17d2cad2f1b782a99595a48fa9f3433f728bd6f6b8abd3f6e53a8fc


왜 이따구로 나오는 걸까요