<div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201603/145802843387FsuxjA46c7N2ElVu8opBdJWYbmtN.png" width="800" height="419" alt="stringtest1.PNG" class="chimg_photo" style="border:none;"></div> <div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201603/1458028436Hi7r56tIAzJyGsV5HvKoJ.png" width="800" height="422" alt="stringtest2.png" class="chimg_photo" style="border:none;"></div> <div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201603/1458028438LDpp6q99LX.png" width="800" height="420" alt="stringtest3.PNG" class="chimg_photo" style="border:none;"></div> <div style="text-align:left;"><br></div> <div style="text-align:left;">안녕하세요. c를 독학하고 있습니다. 그런데 모르는 부분이 생겨서 질문을 드리려고 합니다.</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">문자열에는 '\0'을 안 넣으면 어떨까에서 시작해서 몇가지 테스트를 하게 되었습니다.</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">1. 결과가 lemon ( 으로 나왔는 데 ' ('가 나오게 되는 이유는 무엇인가요?</div> <div style="text-align:left;"> printf가 %s포맷으로 출력할 때는 문자 배열에서 \0이 나올때까지 하나씩 출력하는 데 우연히 그 사이에 ' ('가 있어서 그렇게 된 것인가요? 아니면 전혀 다를까요?</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">2. 배열의 크기를 5로 주었는 데 어떻게 인덱스가 5까지 갔는 데도 컴파일오류도 나지 않고 프로그램이 정상적으로 진행되게 되는 것인가요?</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">3. 1번 그림에서 아스키 코드랑 대조해보고 싶어서 포문을 하나 집어넣었습니다, 하지만 여기에서는 ' ('가 없어졌습니다. 이것은 어째서인가요?</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">p.s. c이전에는 자바를 잠깐 공부한 적이 있습니다.</div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.