<div style="font-family: Gulim; line-height: 21.600000381469727px">#include<stdio.h></div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><br /></div> <div style="font-family: Gulim; line-height: 21.600000381469727px">main()</div> <div style="font-family: Gulim; line-height: 21.600000381469727px">{</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>FILE *fp</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>char s[256];</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>int i = 1 ;</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>fp = fopen("abc.txt", "r");</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><br /></div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>if(fp == NULL)</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>{</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf("Error Print\n");</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>return;</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>}</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>while(1)</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>{</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>fgets(s, 1 , fp);</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>if(feof(fp))</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>break;</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>printf("%4d : %s", i, s);</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>i++;</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>}</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>fclose(fp);</div> <div style="font-family: Gulim; line-height: 21.600000381469727px">}</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><br /></div> <div style="font-family: Gulim; line-height: 21.600000381469727px">수정해서 이렇게 되었는데 못읽어서 에러프린트가 나오더라구요</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><br /></div> <div style="font-family: Gulim; line-height: 21.600000381469727px">이때 못읽으니</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><br /></div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>fp = fopen("abc.txt", "r");</div> <div style="font-family: Gulim; line-height: 21.600000381469727px">이부분에서 파일경로를 써줘야겠다고 생각해서</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span class="Apple-tab-span" style="white-space: pre"> </span>fp = fopen("C:\user\xxx\desktop\code\abc.txt", "r");</div> <div style="font-family: Gulim; line-height: 21.600000381469727px">이렇게 경로를 지정해주면 읽는게 아닌가요?</div> <div style="font-family: Gulim; line-height: 21.600000381469727px">여려가지 경로를 옮겨도보고 댓글도 찬찬히 읽어보면서 어디가 문젠지 생각해봤는데 답이 안나와서 이렇게 질문 올립니다</div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span style="font-size: 9pt">비쥬얼스튜디오 2010 사용하고 있는중입니다.</span></div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span style="font-size: 9pt">어제 썻던 글보니 fopen 을 써놓고서 fclose를 닫지도 않는 완전 기초적인 실수도 하고</span></div> <div style="font-family: Gulim; line-height: 21.600000381469727px"><span style="font-size: 9pt">요새 여러가지로 진도가안나가다보니 답답했나봅니다..<span class="Apple-tab-span" style="white-space: pre"> </span></span></div>
왜 난 여기서 한탄하고있는가
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.