전 멍청한가봐요 <div><br /></div> <div>혼자해도 힘드니</div> <div><br /></div> <div>책에 뻔히 보이는 예제 똑같이 입력해도 출력이 안되는걸보면...참</div> <div><br /></div> <div><div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">#include<stdio.h></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">#include<string.h></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><br /></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><br /></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">int main(int argc, char *argv[])</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">{</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>char usage[] = "usage: trash <-d> filename\n";</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>int ret = 0;</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>char newfilename[256] = "";</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><br /></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>if(argc <=1){</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf(usage);</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>return 1;</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>}</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><br /></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>else if (strcmp(argv[1], "-d") == 0){</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>if(argc <=2){</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf(usage);</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>return 2;</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>}</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>ret = 리무브(argv[2]);</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>if(ret == 0 )</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf("파일을 삭제했습니다. \n");</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>else</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf("파일을 삭제할 수 없습니다.\n");</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>}</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>else {</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>sprintf(newfilename, "%s.bak", argv[1]);</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>ret = rename(argv[1], newfilename);</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>if(ret == 0)</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf("파일명의 끝에 .bak를 추가합니다.\n");</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>else</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf("파일명을 바꿀 수 없습니다.\n");</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><span class="Apple-tab-span" style="white-space: pre"> </span>}</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">}</div></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><br /></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">리무브가 필터링에걸리네요</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px"><br /></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">이렇게 하면 <span style="font-size: 9pt">usage: trash <-d> filename</span></div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">이렇게 뜹니다</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">이렇다는것은</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">밑에 파일삭제라던지 백업을 못한다는 의미인데</div> <div style="font-family: 돋움, dotum, Helvetica, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px; color: #636363; line-height: 16.799999237060547px">어디부분이 잘못된걸까요?</div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.