강의

멘토링

커뮤니티

Inflearn Community Q&A

sjw66863612's profile image
sjw66863612

asked

Yoon Jae-seong's Beginning C Language

for문 조건식 질문

Written on

·

209

0

문자열 내 특정문자를 다른문자로 변환하는 예제를 푸는중입니다. for문의 조건식에 이렇게 배열을 이용한 예제도 있어 사용해 뵜는데 코드는 정상적으로 작동합니다. 그러나 시용된 for문 조건식의 의미를 잘 모르겠어서 질문남깁니다. 혹시 조건식의 의미가 입력된 문자열 크기만큼 반복한다는 의미인가요?

int main(){

char str[100];

char buf1,buf2;

int i;

puts("input:");

gets(str);

puts("transe:");

scanf("%c %c",&buf1,&buf2);

for(i=0;str[i];i++)if(str[i]==buf1)str[i]=buf2;

puts(str);

}

c

Answer 1

0

softcampus님의 프로필 이미지
softcampus
Instructor

죄송합니다. 강의 내용이 아닌 질문에는 답변이 어렵습니다.

 

sjw66863612's profile image
sjw66863612

asked

Ask a question